#include <bits/stdc++.h>

using namespace std;

int n, a[200002];
int q;
int l, r;
int b[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;
        for (j=i+1; j<=n; ++j){
            if (a[j]<a[j-1]){
                if (obrisan) break;
                else obrisan = true;
            }
        }
        b[i] = j;
    }
    //for (int i=1; i<=n; ++i) cout << i << " " << b[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;
}