#include <iostream>
using namespace std;

int main() 
{
    int n,q,a[200000],i;
    cin >> n;
    for(i=1;i<=n;i++)
    {
        cin >> a[i];
    }
    
    cin >> q;
    int l,r,ind,preth = 0;

    for(int j=0;j<q;j++)
    {
        cin >> l >> r;
        ind = 0;
        for(i=l;i<=r;i++)
        {
            if(a[i] < preth)
            {
                if(ind == 0)
                {
                    ind = 1;
                    
                    if(i==l)
                    {
                        ind =0;
                    }
                }
                else
                {
                    cout << "NE" << endl;
                    i=r+2;
                }
            }
            preth = a[i];
            
        }
        
        if(i==r+1)
        {
            cout <<"DA"<< endl;
        }
    }

    return 0;
}