#include <iostream>
#define forn(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
const int oo = 2e5+7;
int n, q, b[oo], p[oo];
ll a[oo];
int bins(int l, int r) {
    while (l < r) {
        int m = (l + r) / 2;
        int num = m - l + 1;
        int np = p[m] - (l == 0 ? 0 : p[l-1]);
        if (num == np) l = m + 1;
        else r = m;
    }
    return l;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    forn(i, n) cin >> a[i];
    forn(i, n-1) b[i] = a[i] <= a[i+1];
    b[n-1] = 1;
    p[0] = b[0];
    forn(i, n-1) p[i+1] = p[i] + b[i+1];

    cin >> q;
    while (q--) {
        int l, r;
        cin >> l >> r;
        l--, r--;
        int br_rastucih = (r == 0 ? 0 : p[r-1]) - (l == 0 ? 0 : p[l-1]) + 1;
        int br_el = r - l + 1;
        if (br_rastucih == br_el) {
            cout << "DA" << endl;
            continue;
        } else if (br_rastucih + 1 < br_el) {
            cout << "NE" << endl;
            continue;
        }
        int idx = bins(l, r);
        if (idx == r || idx == l) {
            cout << "DA" << endl;
            continue;
        }
        bool prvi = a[idx-1] <= a[idx+1];
        bool drugi = idx == r-1 || a[idx] <= a[idx+2];
        cout << (prvi || drugi ? "DA" : "NE") << endl;
    }
}