#include<bits/stdc++.h>
using namespace std;
int n,a[3000],q,l,r,br,a1[3000];
vector <int> v;
int main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        a1[i]=a[i];
    }
    cin>>q;
    for(int i=1;i<=q;i++){
        cin>>l>>r;

    for(int i=l;i<r;i++){
        if(br<=1 and a1[i]>a1[i+1])
            br++;
            a1[i]=-1;
    }
    if(br>1)
        cout<<"NE"<<endl;
    else
        cout<<"DA"<<endl;
    for(int i=1;i<=n;i++){
        a1[i]=a[i];
    }
    br=0;

    }



return 0;
}