#include <bits/stdc++.h>
using namespace std;
int a[100005];
bool r[100005];
int q,n;
int main(){
    cin>>n;

    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(i==1)r[i]=false;
        else if(a[i]>=a[i-1])r[i]=false;
        else r[i]=true;
    }
   /* for(int i=1;i<=n;i++){
            cout<<r[i]<<endl;}
            */
    cin>>q;
    int x,y;
    while(q--){
        cin>>x>>y;
        int br1=0;
        for(int i=x;i<=y;i++){
            if(r[i]==1)br1++;
            if(br1>=2){
            cout<<"NE"<<endl;
            break;}
            }

        if(br1<2) cout<<"DA"<<endl;
        }

    return 0;
}