#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n,ai,q,li,ri,r;
    cin>>n;
    vector <int> a(n);
    for (int i=0; i<n; i++){
        cin>>ai;
        a[i]=ai;
    }
    cin>>q;
    vector <string> rl(q);
    for (int i=0; i<q; i++){
        cin>>li>>ri;
        r=0;
        for (int j=li; j<ri-1; j++){
            if (a[j]<a[j-1]){
                r+=1;
            }
        }
        if (r>1){
            rl[i]="NE";
        }
        else {
            rl[i]="DA";
        }
    }
    for (int i=0; i<q; i++){
        cout<<rl[i]<<endl;
    }

    return 0;
}