#include <bits/stdc++.h>

using namespace std;


int fup(int N, int niz[], int L){
    int c, l = 0, r = N-1;

    while(l < r){
        c = (l + r) / 2;
        if(niz[c] == L){
            return c;
        }
        if(niz[c] > L){
            r = c;
        }
        else{
            l = c;
        }
    }
    return l;
}

int main()
{
    int N;
    cin >> N;
    int A[N];
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }

    int m[N], M = 0;
    for(int i = 0; i < N - 1; i++){
        if(A[i] > A[i+1]){
            m[M] = i;
            M++;
        }
    }

    int m2[M], M2 = 0;
    for(int i = 0; i < N-2; i++){
        if(A[i] > A[i + 2]){
            m2[M2] = i;
            M2++;
        }
    }

    int Q,r,l,mc;
    cin >> Q;
    for(int cntr = 0; cntr < Q; cntr++){
        cin >> l >> r;
        r -= 1;
        l -= 1;
        if(r - l < 2){
            cout << "DA" << endl;
        }
        else{
            mc = 0;
            for(int i = 0; i < M; i++){
                if(m[i] >= r){
                    break;
                }
                if(m[i] >= l){
                    mc++;
                    if(m[i] != l){
                        for(int k = 0; k < M2; k++)
                        {
                            if(m2[k] > i){
                                break;
                            }
                            if(m2[k] == i){
                                if(k != 0 && m2[k-1] == i-1){
                                    mc++;
                                }
                            }
                        }
                    }
                }
                if(mc > 1){
                    break;
                }
            }
            if(mc > 1){
                cout << "NE" << endl;

                //cout << "mc = " << mc << endl;

            }
            else{
                cout << "DA" << endl;

                //cout << "mc = " << mc << endl;

            }
        }
    }


    /*
    cout << endl << "manji: ";
    for(int i = 0; i < M; i++){
        cout << m[i]<< " ";
    }
    cout << endl << "manji2: ";
    for(int i = 0; i < M2; i++){
        cout << m2[i]<< " ";
    }
    cout << endl;
    */

    return 0;
}