#include <bits/stdc++.h>
using namespace std;
int n,q,niz[200005],a,b,br,niz2[200005],PS[200005];
int main(){
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>niz[i];
        if(niz[i-1]>niz[i]){
            niz2[i-1]=1;
        }
    }
    for (int i=1; i<=n; i++) PS[i]=PS[i-1]+niz2[i];
   // for (int i=1; i<=n; i++)cout<<PS[i]<<" ";
   // cout<<endl;
    cin>>q;
     for(int i=1; i<=q; i++){
        cin>>a>>b;

        if(PS[b-1]-PS[a-1]>1)
            cout<<"NE"<<endl;
        else cout<<"DA"<<endl;
     }
    /*
    for(int i=1; i<=q; i++){
            br=0;
        cin>>a>>b;
        for(int j=a+1; j<=b; j++){
            if(niz[j]<niz[j-1])br++;
            if(br>1){
                cout<<"NE"<<endl;
                break;
        }
    }
    if(br<=1){
     cout<<"DA"<<endl;}
    }
    */
return 0;
}