#include <iostream>

using namespace std;

int main()
{
    int n,q,i,p=0,s=0,j;
    cin >> n;
    int a[n],b[n];
    for (i=0;i<n;i++)
    {
        cin >> a[i];
        if (i>0 && a[i]<a[i-1])
        {
            for (j=p;j<s;j++){
                b[j]=i-1;
            }
            p=s;
            s=i;
        }else if (i>1 && a[i]<a[i-2]){
            for (j=p;j<s;j++){
                b[j]=i-1;
            }
            p=s;
        }
    }
    for (i=p;i<n;i++)
    {
        b[i]=n-1;
    }
    cin >> q;
    bool t[q];
    int l,r;
    for (i=0;i<q;i++){
        cin >> l >> r;
        if (b[l-1]>=r-1){
            t[i]=true;
        }else{
            t[i]=false;
        }
    }
    for (i=0;i<q;i++){
        if (t[i])
            cout << "DA" << endl;
        else
            cout << "NE" << endl;
    }
    return 0;
}