#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int n;
    scanf("%d",&n);

    int a[n],problematicni[n],baksuz=0;
    for (int i=0; i<n;i++) {
       scanf("%d",&a[i]);
       if (i>0 && a[i-1]>a[i])
       {
           problematicni[baksuz]=i;
           baksuz++;
       }
    }
        int q;
    scanf("%d",&q);

    int l[q],r[q];
    int resenje[q];

    for (int i=0;i<q;i++) {
        scanf("%d %d",&l[i],&r[i]);
        int brojac=0;
        for (int j=0;j<baksuz;j++)
        {
            if (l[i]<=problematicni[j] && r[i]>problematicni[j])
                brojac++;
        }
        if (brojac>1)
            resenje[i]=-1;
        else
            resenje[i]=1;
    }
    for (int i=0;i<q;i++)
    {
        if (resenje[i]==-1)
            printf("NE\n");
        else
            printf("DA\n");
    }

    return 0;
}