#include <bits/stdc++.h>

using namespace std;

int n,q,A[200010],b1,b2,U[200010];

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;
        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");
        else printf("DA\n");
    }
    return 0;
}