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

}