#include <bits/stdc++.h>

using namespace std;

int main()
{
    int i, j, N, Q, e;
    cin>>N;
    int A[N], ANS[N]={0}, l[N], r[N];
    cin>>A[0];
    for (i=1;i<N;i++)
    {
        cin>>A[i];
        if (A[i-1]>A[i])
            ANS[i-1]=1;
    }
    cin>>Q;
    for (i=0;i<Q;i++)
        cin>>l[i]>>r[i];
    for (i=0;i<Q;i++)
    {
        e=0;
        for (j=l[i]-1;j<r[i]-1;j++)
        {
            if (ANS[j]==1)
            {
                e++;
                if (e>1)
                {
                    cout<<"NE";
                    j=N;
                }
            }
        }
        if (e<=1)
            cout<<"DA";
        if (i+1<Q)
            cout<<endl;
    }
    return 0;
}