#include <bits/stdc++.h>
using namespace std;
int n, q, l, r, a[200005], br;
int main () {
    cin >> n;
    for (int i=1; i<=n; i++){
        cin >> a[i];
    }
    cin >> q;
    for (int j=1; j<=q; j++){
        cin >> l >> r;
        br=0;
        for (int i=l; i<=r; i++){
            if(a[i]<a[i-1]){
                br++;
            }
        }
        if(br<=1){cout << "DA" << endl;}
            else{cout << "NE" << endl;}
    }
    return 0;
}