#include <bits/stdc++.h>

using namespace std;

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