#include <bits/stdc++.h>
using namespace std;
int n,a[200005],q,l,r,suma[200005];
void niz(){
    suma[1]=1;
    for (int i=1;i<=n;i++){
        if (a[i]>=a[i-1]) suma[i]=1;
        else suma[i]=0;
    }
}
void prefiks(){
    suma[1]=1;
    for (int i=2;i<=n;i++){
        suma[i]=suma[i-1]+suma[i];
    }
}
int  main(){
    cin>>n;
    for (int i=1;i<=n;i++){
        cin>>a[i];
    }
    niz();
    prefiks();
    cin>>q;
    for (int i=1;i<=q;i++){
        cin>>l>>r;
        int br=(suma[r]-suma[l])+1;
        int clan=r-l+1;
        if (clan-br<=1) cout<<"DA"<<endl;
        else cout<<"NE"<<endl;
        //cout<<(suma[r]-suma[l])+1<<" ";
    }

    return 0;
}