#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    long long n, q;
    cin >> n;
    vector <long long> a(n+1);
    for(long long i = 1; i <= n; i++)
        cin >> a[i];

    vector <pair<long long, long long>> g(n);
    long long j = 0;
    for(long long i = 1; i < n; i++)
        if(a[i] > a[i+1]) {
            g[j].first = i;
            g[j].second = i+1;
            j++;
        }


    cin >> q;
    for(long long i = 0; i < q; i++) {
        long long l, r;
        cin >> l >> r;
        long long br_gr = 0;
        for(long long k = 0; k < j; k++) {
            if(g[k].first >= l && g[k].second > l && g[k].first < r && g[k].second <= r)
                br_gr++;
            if(br_gr > 1)
                break;
        }

        if(br_gr > 1)
            cout << "NE" << endl;
        else
            cout << "DA" << endl;
    }

    return 0;
}