#include <bits/stdc++.h>
#define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
#define pb push_back

using namespace std;
int n;
int niz[200005];
int desno[200005];
int pref[200005];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    ff(i,1,n){
        cin >> niz[i];
    }
    ff(i,1,n-1){
        if(niz[i]>niz[i+1])pref[i] = 1;
    }
    desno[n-1]=n+1;
    for(int i=n-2; i>=1; i--){
        if(pref[i+1])desno[i] = i+1;
        else desno[i] = desno[i+1];
    }

    ff(i,1,n-1)pref[i] += pref[i - 1];

    int q;
    cin >> q;
    while(q--){
        int l,r;
        cin >> l >> r;
        int sum = pref[r-1]-pref[l-1];
        if(sum == 0){
            cout << "DA\n";
            continue;
        }
        if(sum>1)cout << "NE\n";
        else{
            if(pref[l]-pref[l-1]){
                cout << "DA\n";
            }
            else{
                int koji = desno[l];
                if(niz[koji-1]<=niz[koji+1]){
                    cout << "DA\n";
                }
                else{
                    int posle = niz[koji+2];
                    if(koji+2>r)posle = 1e9;
                    if(niz[koji]<=posle){
                        cout << "DA\n";
                    }
                    else cout << "NE\n";
                }
            }
        }
    }

    return 0;
}