#include <iostream>

using namespace std;

int niz[200008];
int l[200008], r[200008];
int doi[200008];

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


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

    int q; cin >> q;

    doi[0] = 0;
    int brisanja = 0;
    int poslednji = 0;

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

    for(int i = 1; i < n; i++)
    {
        if(niz[i] < niz[poslednji])
        {
            brisanja++;
        }
        doi[i] = brisanja;
        poslednji = i;
    }

    for(int i = 0; i < q; i++)
    {
        int br;
        if(l[i] == 1)
        {
            br = doi[r[i] - 1];
        }
        else
        {
            br = doi[r[i] - 1] - doi[l[i] - 1];
        }

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

    return 0;
}