#include <iostream>

using namespace std;

int n_padova(int a[],int d,int g)
{
    int c=0;
    int obr=1000000;
    cin.tie(0);
    cout.tie(0);
    for(int j=d+1;j<=g;j++)
    {
        if(a[j-1]>a[j]&&c==0)
        {
            if(a[j+1]<a[j]&&j+1<=g)return 2;
            else if(j+1<=g){
                if(a[j-2]>a[j]&&j-2>=d){
                    c++;
                    obr=j;
                }
                else{
                    c++;
                    obr=j-1;
                }
            }
        }
        else if(c==1){
            if(j-1==obr){
                if(a[j-2]>a[j])return 2;
            }
            else if(a[j-1]>a[j])return 2;
        }
    }
    return c;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int a[200000];
    int n;
    int q;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int r,t;
        cin>>r>>t;
        if(n_padova(a,r-1,t-1)>1)cout<<"NE"<<endl;
        else cout<<"DA"<<endl;
    }
    return 0;
}