#include <iostream>


using namespace std;


int a[200005];
int rast[200005];


int main()
{
    int n;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
    }
    int x=a[n-1];
    int suma=1;
    rast[n-1]=1;
    for(int i=n-2; i>=0; i--)
    {
        if(a[i]<=x)
        {
            rast[i]=suma+1;
            suma++;
            x=a[i];
        }
        else
        {
            rast[i]=1;
            x=a[i];
            suma=1;
        }
    }
    int l, r;
    int q;
    cin>>q;
    int j;
    for(int i=0; i<q; i++)
    {
        cin>>l>>r;
        l--;
        r--;
        if(rast[l]>=r-l+1)cout<<"DA"<<endl;
        else
        {
            j=rast[l]+l+1;
            if(rast[j]>=r-j+1 && a[j-2]<=a[j])cout<<"DA"<<endl;
            else
            {
                if(rast[l+1]>=r-l)cout<<"DA"<<endl;
                else
                {
                    j=l+rast[l];
                    if(rast[j]>=r-j+1 && a[j]>=a[j-2])cout<<"DA"<<endl;
                    else
                        cout<<"NE"<<endl;
                }

            }
        }
    }

}