#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    ll A[n];
    vector<ll> B(n,0);
    int br = 0;
    cin>>A[0];
    for(ll i =1;i<n;i++){
        cin>>A[i];
        if(A[i-1]>A[i]){B[br]=i;br++;}
    }
    ll q;
    cin>>q;
    for(ll i =0;i<q;i++){
        ll l,r;
        cin>>l>>r;
        bool resi = true;
        ll e = 0;
        for(ll i =0;i<br;i++){
            if(B[i]>l&&B[i]<r){
                e++;
                if(e>1)
                {
                    cout<<"NE"<<endl;
                    resi=false;
                    break;
                }
            }
        }
        if(resi)cout<<"DA"<<endl;
    }

}