#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }


    vector<pair<int, int>> sortirani;

    int start = 0;
    for (int i = 1; i < n; i++) {
        if (a[i] < a[i - 1]) {
            sortirani.push_back({start, i - 1});
            start = i;
        }
    }
    sortirani.push_back({start, n - 1});

    set<pair<int, int>> dobri;
    for (int i = 0; i < (int)sortirani.size() - 1; i++) {
        // da li mozemo spojiti dva sortirana podniza
        int last = sortirani[i].second;
        int first = sortirani[i + 1].first;

        if ((last > 0 && a[last - 1] <= a[first]) || (first < n - 1 && a[last] <= a[first + 1])) {
            dobri.insert({sortirani[i].first, sortirani[i + 1].second});
        }
        else {
            dobri.insert(sortirani[i]);
        }
    }

      /*cout << "Dobri podnizovi su: \n";
    for (auto it = dobri.begin(); it != dobri.end(); it++){
        cout << it->first << " " << it->second << "\n";
    }

    cout << "***********\n"; */

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

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

       // cout << "------ " << l << " " << r << " -----\n";

        // trazimo da li je [l, r] podniz nekog dobrog podniza
        auto it = dobri.lower_bound({l, r});

        if (it == dobri.begin()) {
            if (it->first <= l && it->second >= r) cout << "DA\n";
            else cout << "NE\n";
        }
        else if (it != dobri.begin()) {
            // postoji podniz koji pocinje indeksom manjim od l
            if (it == dobri.end()) --it;

            if (it->first > l) --it;

            if (it->second >= r) cout << "DA\n";
            else cout << "NE\n";
        }
    }
    return 0;
}