#include <iostream>
#include <set>

using namespace std;

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

    set<pair<int, int>> forbidden;

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

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

    int ind[n];
    ind[0] = 0;
    i = 1;
    int index = 0;
    while(i<n)
    {
        while(a[i]==a[i-1])
        {
            ind[i] = index;
            i++;
        }
        ind[i] = i;
        index = i;
        i++;
    }


    //for(i=0;i<n;i++){cout << ind[i]  << " ";}cout << endl;

    for(i=0;i<n-3;i++)
    {
        if(ind[i]==ind[i+1] && ind[i+2]==ind[i+3] && ind[i]!=ind[i+2] && a[ind[i]]>a[ind[i+2]])
        {
            forbidden.insert(make_pair(i, i+3));
        }
    }

    //for(i=0;i<n;i++){cout << b[i]  << " ";}cout << endl;
    cin >> q;
    while(q--)
    {
        cin >> l >> r;
        l--;
        r--;

        bool ok = true;
        for(auto x : forbidden)
        {
            if(l <= x.first && x.second <= r)
            {
                cout << "NE" << endl;
                ok = false;
            }
        }

        if(ok){
        if(b[r]-b[l]<=1)
        {
            cout << "DA" << endl;
        }
        else
        {
            cout << "NE" << endl;
        }
        }
    }
}