#include <iostream>
using namespace std;

int main() 
{
    int n,q,a[200000],i,preth = 0,prethh = 0;
    int b[200000],r,l;
    
    scanf("%d", &n);
    b[0] = 0;
    for(i=1;i<=n;i++)
    {
        scanf("%d", &a[i]);
        b[i] = b[i-1];
        if(preth > a[i])
        {
            b[i]++;
            if(prethh > a[i])
            {
                b[i]++;
            }
        }
        prethh = preth;
        preth = a[i];
    }
    scanf("%d", &q);
    
    for(int j=0;j<q;j++)
    {
        scanf("%d%d",&l,&r);
        
        if((b[r]-b[l]) > 1)
        {
            printf("NE\n");
        }
        else
        {
            printf("DA\n");
        }
    }
    
    return 0;
}