#include <iostream>

using namespace std;

int main()
{
    long long int n, q, i, l, r;
    cin >> n;
    long long int a[n];
    for(i=0;i<n;i++)
    {
        cin >> a[i];
    }
    cin >> q;
    while(q--)
    {
        cin >> l >> r;
        l--;
        r--;
        int br=0;
        for(i=l+1;i<=r && br<=1;i++)
        {
            if(a[i]<a[i-1])
            {
                br++;
            }
        }
        if(br<=1)
        {
            cout << "DA" << endl;
        }
        else
        {
            cout << "NE" << endl;
        }
    }
}