#include <bits/stdc++.h>
#define ll long long

using namespace std;

solve() {
    int n;
    cin >> n;
    int arr[n];
    for (int i=0;i<n;i++) {
        cin >> arr[i];
    }
    bool used = false;
    int last_change_index = 0;
    int last_possible_index[n];
    int last_possible_gap[n];
    for (int i=0;i<n;i++) {
        last_possible_gap[i] = 200007;
    }
    last_possible_index[0] = 0;
    for (int i=1;i<n;i++) {
        if (arr[i] >= arr[i-1]) {
            last_possible_index[i] = last_possible_index[i-1];
            if (used == true) {
                if ((i-1) == last_change_index) {
                    if (arr[i] >= arr[i-2]) {
                        last_possible_index[i] = last_possible_gap[i-1];
                    }
                }
            }

        }
        else {
            last_possible_gap[i] = last_change_index;
            if (used == false) {
                used = true;
                last_possible_index[i] = last_possible_index[i-1];
                last_change_index = i;
            }
            else {
                if (arr[i] >= arr[i-2]) {
                    last_possible_index[i] = last_change_index;
                    last_change_index = i;
                }
                else {
                    last_possible_index[i] = i-1;
                    last_change_index = i;
                }
            }
        }
    }
    int q;
    cin >> q;
    for (int i=0;i<q;i++) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        if (x >= min(last_possible_index[y], last_possible_gap[y]))
            cout << "DA\n";
        else
            cout << "NE\n";
    }

    //for (int i=0;i<n;i++) {
    //    cout << last_possible_index[i] << "-";
    //    cout << last_possible_gap[i] << " ";
    //}
}


int main()
{
    solve();
    //cout << "Hello world!" <<endl;
    return 0;
}