#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> a(n);

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

    vector<int> dp(n);

    for(int i = 0; i < n - 1; i++)
    {
        dp[0] += (a[i] <= a[i+1]);
        i += n*(a[i] > a[i+1]);
    }

    for(int j = 1; j < n - 1; j++)
    {
        if(dp[j-1] > 0) dp[j] = dp[j-1] - 1;
        else
        {
            for(int i = j; i < n - 1; i++)
            {
                dp[j] += (a[i] <= a[i+1]);
                i += n*(a[i] > a[i+1]);
            }
        }
    }

    int q;
    cin >> q;

    vector<int> r(q,0);

    for(int i = 0; i < q; i++)
    {
        int l,d;
        cin >> l >> d;
        d -= l;
        l--;

        r[i] = 0;

        if(d <= 1) r[i] = 1;

        if(r[i] == 0) r[i] = (dp[l] + dp[l + dp[l] + 1] >= d - 1);
    }

    for(int i : r)
    {
        if(i == 0) cout << "NE";
        else cout << "DA";
        cout << "\n";
    }

    return 0;
}