#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;

    vector<int> v(n);
    for(auto &z : v) cin >> z;

    vector<int> pref(n - 1);

    vector<int> losi;
    losi.reserve(n);

    for(int i = 0; i + 1 < n; ++i) {
        pref[i] = (v[i] <= v[i + 1]);

        if(v[i] > v[i + 1]) {
            losi.push_back(i);
        }
    }

    for(int i = 1; i < n - 1; ++i) {
        pref[i] += pref[i - 1];
    }

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

        --l, --r;

        if(l == r) {
            cout << "DA" << '\n';
            continue;
        }

        auto it = lower_bound(losi.begin(), losi.end(), l);
        if(it == losi.end()) {
            cout << "DA" << '\n';
            continue;
        }

        auto sle = it;
        ++sle;

        if(sle == losi.end() || *sle > r - 1) {
            int ind = *it;
            if(ind == l) {
                cout << "DA" << '\n';
                continue;
            }
            int pre = v[ind - 1];
            int posle = v[ind + 1];

            if(pre <= posle) {
                cout << "DA" << '\n';
            } else {
                cout << "NE" << '\n';
            }
        } else {
            cout << "NE" << '\n';
            continue;
        }
    }
}