#include <bits/stdc++.h>


using namespace std;

typedef long long ll;

vector<ll> transform1(vector<ll> a,ll n){
    vector<ll> a1(n);
    if(a.size()==1){
        a1[0]=1;
    }
    else{
        a1[0]=0;
        for(int i=0;i<n-1;i++){
            if(a[i]<=a[i+1]){
                a1[i+1]=1;
            }
            else{
                a1[i+1]=0;
            }
        }
    }
    return a1;
}

vector<ll> transform2(vector<ll> a1, ll n){
    vector<ll> a2(n);
    if(a1.size()==1){
        return a1;
    }
    else{
        a2[0]=a1[0];
        for(ll i=1;i<n;i++){
            a2[i]=a1[i]+a2[i-1];
        }
    }
    return a2;
}

void upiti(vector<pair<ll,ll>> b, vector<ll> a,ll n,ll m){
    ll p;
    for(ll i=0;i<m;i++){
        if(b[i].first==b[i].second){
            cout<<"DA"<<'\n';
        }
        else{
            p=a[b[i].second-1]-a[b[i].first-1];
            //cout<<p<<" "<<b[i].second-b[i].first<<" "<<(b[i].second-b[i].first)-1<<'\n';
            if(p==b[i].second-b[i].first||p==(b[i].second-b[i].first)-1){
                cout<<"DA"<<'\n';
            }
            else{
                cout<<"NE"<<'\n';
            }
        }
    }

}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m;
    cin>>n;
    vector<ll> a(n),a1(n),a2(n);
    for(ll i=0;i<n;i++){
        cin>>a[i];
    }
    cin>>m;
    vector<pair<ll,ll>> b(m);
    for(ll i=0;i<m;i++){
        cin>>b[i].first>>b[i].second;
    }
    a1=transform1(a,n);
    a2=transform2(a1,n);
    /*
    for(ll i=0;i<n;i++){
        cout<<a1[i]<<'\t';
    }
    cout<<'\n';
     for(ll i=0;i<n;i++){
        cout<<a2[i]<<'\t';
    }
    cout<<'\n';
    */
    upiti(b,a2,n,m);
    return 0;
}