#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;
        }

        int suma = pref[r - 1];
        if(l - 1 >= 0) suma -= pref[l - 1];

        int vece = (r - l + 1) - 1;
        if(suma < vece - 1) {
            cout << "NE" << '\n';
            continue;
        } else if(suma == vece) {
            cout << "DA" << '\n';
            continue;
        } else {
            int ind = *lower_bound(losi.begin(), losi.end(), l);

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

            bool ok = (v[ind - 1] <= v[ind + 1]);
            cout << (ok ? "DA" : "NE") << '\n';
        }
        //cout << ((suma >= vece) ? "DA" : "NE") << '\n';
    }
}