#include <bits/stdc++.h>

using namespace std;

int n;

bool solve(int *a, int l, int d) {
    int br = 1;
    for(int i=l; i<d; ++i) {
        if(a[i] > a[i+1]) {
            if(br)
                br--;
            else
                return false;
        }
    }
    return 1;
}

int main(void) {

    cin >> n;
    int a[n];
    //int sum[n];

    cin >> a[0];
    //sum[0] = 0;
    for(int i=1; i<n; ++i) {
        cin >> a[i];
        /*
        int k = i-1, br = 0;
        while(k >= 0 && a[k] != a[i]) {
            if(a[k] > a[i]) br++;
            k--;
        }
        if(k < 0)
            sum[i] = br;
        else
            sum[i] = sum[k] + br;*/
    }

    //for(int i=0; i<n; ++i) {
    //    sum[i] += sum[i-1];
    //    cout << sum[i] << " ";
    //}
    //cout << endl;

    int q;
    cin >> q;

    while(q--) {
        int l, r;
        cin >> l >> r;
        cout << (solve(a, l-1, r-1) ? "DA\n" : "NE\n");
        //cout << "diff: " << abs(sum[r-1] - sum[l-1]) << " => " << (abs(sum[r-1] - sum[l-1]) <= 1 ? "DA\n" : "NE\n");
    }

    return 0;
}