#include <bits/stdc++.h>

using namespace std;

int n, a[200002];
int q;
int l, r;
int b[200002], prviObrisan[200002];
bool obrisan;

int main()
{
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(false);

    cin >> n;
    for (int i=1; i<=n; ++i) cin >> a[i];
    for (int i=1; i<=n; ++i){
        obrisan = false;
        int j;
        if (i==1){
            for (j=i+1; j<=n; ++j){
                if (a[j]<a[j-1]){
                    if (obrisan){
                        break;
                    }
                    else {
                        obrisan = true;
                        prviObrisan[i]=j-1;
                    }
                }
            }
            b[i] = j;

        }
        else{
            if(i<n){
                if (i<=prviObrisan[i-1]) {
                    b[i] = b[i-1];
                    prviObrisan[i] = prviObrisan[i-1];
                }
                else {
                    for (j=i+1; j<=n; ++j){
                        if (a[j]<a[j-1]){
                            if (obrisan){
                                prviObrisan[i] = j-1;
                                break;
                            }
                            else obrisan = true;
                        }
                    }
                    b[i] = j;

                }
            }
            else b[n] = n+1;
        }

    }
    //for (int i=1; i<=n; ++i) cout << i << " " << b[i] << " " << prviObrisan[i] <<  endl;
    cin >> q;
    for (int i=0; i<q; ++i){
        cin >> l >> r;
        if (b[l]<=r) cout << "NE" << endl;
        else cout << "DA" << endl;
    }

    return 0;
}