#include <bits/stdc++.h>
#define MAXN 200010
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int, int>

using namespace std;

void solve()
{
    int n;
    cin >> n;
    vector<int> a(n+1), p(n+1);
    p[0] = 0; a[0] = -1;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        if (a[i] >= a[i-1])
        {
            p[i] = p[i-1];
        }
        else
        {
            p[i] = p[i-1] + 1;
        }
    }

    int q;
    cin >> q;
    while (q--)
    {
        int l, r;
        cin >> l >> r;
        if (p[r] - p[l] == 0)
        {
            cout << "DA\n";
        }
        else if (p[r] - p[l] == 1)
        {
            int bl = l, br = r, bmid;
            while (br - bl > 1)
            {
                bmid = (br + bl) / 2;
                if (p[bmid] == p[l]) bl = bmid;
                else br = bmid;
            }
            if (bl == l || br == r || (a[br + 1] >= a[bl]))
            {
                cout << "DA\n";
            }
            else
            {
                cout << "NE\n";
            }
        }
        else
        {
            cout << "NE\n";
        }
    }

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int t = 1;
    //cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}