#include <bits/stdc++.h>

using namespace std;

int n,q,A[200010],b1,b2,U[200010],l,r,s;
vector<int> V;

int main()
{
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&A[i]);
        if(A[i]<A[i-1])
        {
            U[i] = U[i-1] + 1;
            V.push_back(i);
        }
        else U[i] = U[i-1];
    }
    scanf("%d",&q);
    while(q--)
    {
        scanf("%d %d",&b1,&b2);
        if(U[b2]-U[b1]>1)
        {
            printf("NE\n");
            continue;
        }
        if(U[b2]-U[b1]==0)
        {
            printf("DA\n");
            continue;
        }
        l = -1;
        r = V.size();
        while(l+1<r)
        {
            s = (l+r)/2;
            if(V[s]<=b1) l = s;
            else r = s;
        }
        if(V[r]==b1+1)
        {
            printf("DA\n");
            continue;
        }
        if(V[r]==b2)
        {
            printf("DA\n");
            continue;
        }
        if(A[V[r]]>=A[V[r]-2])
        {
            printf("DA\n");
            continue;
        }
        if(A[V[r]-1]<=A[V[r]+1])
        {
            printf("DA\n");
            continue;
        }
        printf("NE\n");
    }
    return 0;
}