#include <bits/stdc++.h>
#define MAX_N 200001

using namespace std;

int prefix[MAX_N + 1];
int diff[MAX_N + 1];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for(int i = 0; i < n; i++) {
        if(n > 1 && a[i] > a[i + 1]) {
            diff[i] = 1;
            if(i != 0 && a[i - 1] >= a[i]) {
                diff[i - 1] = 1;
            }
        }
    }
    for(int i = 1; i < n + 1; i++) {
        prefix[i] = prefix[i - 1] + diff[i - 1];
    }
    int q;
    cin >> q;
    while(q--) {
        int l, r;
        cin >> l >> r;
        if(prefix[r - 1] - prefix[l - 1] > 1) {
            cout << "NE\n";
        } else {
            cout << "DA\n";
        }
    }
    return 0;
}