#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(){
    int c=0;
    for (int i=1;i<n;i++){
        if (x[i]-x[i+1]>0) c++;
        a[i]=c;
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i=1;i<=n;i++){
        cin >> x[i];
    }
    prefix();
//    for (int i=1;i<n;i++) cout << a[i] << " ";
//    cout << "\n";
    cin >> q;
    for (int i=1;i<=q;i++){
        cin >> l >> r;
        br=0;
        if (a[r-1]-a[l-1]>1) cout << "NE\n";
        else cout << "DA\n";
    }
    return 0;
}