#include <bits/stdc++.h>\

using namespace std;

int main()
{
    int N,A[200000],Q,levi,desni,pr;
    scanf("%d",&N);
    for(int i =0;i<N;i++){
        scanf("%d",&A[i]);
    }
    scanf("%d",&Q);
    int dp[200000];
    dp[0]=1;
    for(int i = 1;i<N;i++){
        if(A[i]>=A[i-1])dp[i]=dp[i-1]+1;
        else dp[i]=1;
    }
    for(int i = 0;i<Q;i++){
        scanf("%d%d",&levi,&desni);
        if(dp[desni-1]>=desni-levi-1)printf("DA\n");
        else printf("NE\n");
    }
}