#include<bits/stdc++.h>
using namespace std;
int n,a,q,l,r,br;
vector <int> v,v1;
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a);
        v.push_back(a);
    }
    v1=v;
    scanf("%d",&q);
    for(int i=1;i<=q;i++){
        scanf("%d",&l);
        scanf("%d",&r);

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

    }



return 0;
}