#include <bits/stdc++.h>

#define ll long long
#define loop(i, s, e) for(ll i = s; i < e; i++)

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n, q, l, r;
    cin >> n;
    vector<ll> arr(n);
    loop(i, 0, n) {
        cin >> arr[i];
    }

    vector<ll> prefix(n);
    loop(i, 1, n) {
        ll val = 0;
        if (arr[i] < arr[i - 1]) {
            val = 1;
        }

        prefix[i] = prefix[i - 1] + val;
    }

    cin >> q;
    loop(i, 0, q) {
        cin >> l >> r;
        r--;
        l--;

        if (prefix[r] - prefix[l] <= 1) {
            cout << "DA\n";
        } else {
            cout << "NE\n";
        }
        // cout << prefix[r] - prefix[l] << '\n';
    }

    return 0;
}