#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
int x[200005],n,l,r,q,br,a[200005];

void prefix(){
    for (int i=1;i<n;i++){
        a[i]=x[i]-x[i+1];
    }
}
int main(){
    cin >> n;
    for (int i=1;i<=n;i++){
        cin >> x[i];
    }
    cin >> q;
    prefix();
//    for (int i=1;i<n;i++){
//        cout << a[i] << " ";
//    }
    cout << "\n";
    for (int i=1;i<=q;i++){
        cin >> l >> r;
        br=0;
        if (r-l==0) {
            cout << "DA\n";
            continue;
        }
        if (r-l==1){
            if (a[r-1]>0) cout << "NE\n";
            else cout << "DA\n";
            continue;
        }
        vector <int> v,v1;
        for (int j=l;j<r;j++){
            v.push_back(a[j]);
            v1.push_back(a[j]);
        }
        sort(v.begin(),v.end());
//        cout << v[r-l-1] << " " << v[r-l-2] << "\n";
        if (v[r-l-1]>0 and v[r-l-2]>0) cout << "NE\n";
        else {
//                cout << "USO\n";
            bool tac=true;
            for (int j=0;j<r-l;j++){
                if (v[j]>0 or v1[j]>0) continue;
                if (v[j]>v1[j]) {
                    tac=false;
                    break;
                }
            }
            if (tac) cout << "DA\n";
            else cout << "NE\n";
        }
    }

    return 0;
}

/*
10
3 8 9 10 4 2 7 9 3 8
*/