#include <bits/stdc++.h>

using namespace std;

void compute_ans(int arr[], int n, int ans[]) {

    ans[n - 1] = n - 1;
    for(int i = n - 2; i >= 0; i--) {
        ans[i] = i;
        if(arr[i] <= arr[i + 1])
            ans[i] = ans[i + 1];
    }
    for(int i = 0; i < n; i++)
        cout << ans[i] << " ";cout << endl;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;

    int arr[n];
    for(int i = 0; i < n; i++)
        cin >> arr[i];

    int ans[n];
    compute_ans(arr, n, ans);

    int q;
    cin >> q;
    while(q--) {
        int l, r;
        cin >> l >> r;
        l--; r--;

        if(ans[l] >= r - 1 || ans[l + 1] >= r || ans[ans[l] + 2] >= r)
            cout << "DA" << endl;
        else
            cout << "NE" << endl;
    }
    return 0;
}