#include <iostream>
using namespace std;

struct podniz{
    int pocetak;
    int kraj;
};
int main()
{
    bool s = true;
    int n,l = 0;
    cin >> n;
    int a[n];
    int A[n];
    for(int i = 0; i < n; i++)
    {
        cin >> A[i];
    }
    int q;
    cin >> q;
    podniz b[q];
    for(int i = 0; i < q; i++)
    {
        cin >> b[i].pocetak >> b[i].kraj;
    }
    for(int i = 0; i < q; i++)
    {
        int c[b[i].kraj - b[i].pocetak + 1];
        for(int j = b[i].pocetak - 1; j <= b[i].kraj - 1; j++)
        {
            c[l] = A[j];
            l++;
        }
        l = 0;
        while(c[l] >= c[l + 1] && l <= b[i].kraj - 1)
        {
            l++;
        }
        if(l == b[i].kraj - 1)
        {
            cout << "DA " << endl;
            s = false;
        }
        else if((l > 0 && l <= b[i].kraj - 2) && (c[l - 1] > c[l + 1] && c[l] != c[l + 1]))
        {
            cout << "DA " << endl;
            s = false;
        }
        if(s)
        {
            while(c[l] >= c[l + 1] && l <= b[i].kraj - 1)
            {
                l++;
            }
            if(l = b[i].kraj - 2 && c[l - 1] >= c[l + 1])
            {
                cout << "NE " << endl;
            }
            else if(l != b[i].kraj - 1)
            {
                cout << "DA " << endl;
            }
            else if(l == b[i].kraj - 1)
            {
                cout << "DA " << endl;
            }
        }
        s = true;

    }
    return 0;
}