#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
int x[200005],n,l,r,q,br;
int main(){
    cin >> n;
    for (int i=1;i<=n;i++){
        cin >> x[i];
    }
    cin >> q;
    for (int i=1;i<=q;i++){
        cin >> l >> r;
        br=0;
        for (int j=l;j<r;j++){
            if (br>1) break;
            if (x[j]>x[j+1]) br++;
        }
        if (br>1) cout << "NE\n";
        else cout << "DA\n";
    }

    return 0;
}