#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,a[100000],q,i,j,l,r,cc,counter;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    scanf("%d",&q);
    for(j=0;j<q;j++)
    {
        scanf("%d%d",&l,&r);
        counter=0;
        while(l<r)
        {
            if(a[l]<a[l+1])
            {
                a[l]=cc;
                cc=a[l+1];
                a[l+1]=a[l];
                counter++;
                if(counter>1)
                {
                    printf("NE\n");
                    break;
                }
                else
                {
                    l++;
                }
            }
            else
            {
                l++;
            }
        }
        if(counter<2)
        {
            printf("DA\n");
        }

    }
    return 0;
}