#include <stdio.h>
#include <stdlib.h>
int provera(int n, int niz[n], int levi, int desni)
{
    levi--;
    desni--;

    if(desni - levi <= 2)
    {
        return 1;
    }
    /*int brr[n], l = 1;

    brr[0] = arr[0];
    for (int i = 1; i < n; i++) {
        if (brr[l - 1] <= arr[i]) {
            brr[l] = arr[i];
            l++;
        }
    }

    // Print the sorted array
    for (int i = 0; i < l; i++)
        cout << brr[i] << " ";


*/
    int br = 0, pom = 0;
    for(int i = levi; levi < desni; levi++)
    {
        if(br == 2)
        {
            return 0;
        }
        if(niz[levi]<niz[desni] && (pom == 0))
        {
            br++;
            pom=1;

        }
        else{
            pom = 0;
        }
    }
    return 1;
}

int main()
{
    int n, q, lev, des;
    scanf("%d", &n);
    int niz[n];
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &niz[i]);
    }
    scanf("%d", &q);
    int niz1[q];
    for(int i = 0; i < q; i++)
    {
        scanf("%d%d", &lev, &des);
        niz1[i] = provera(n, niz, lev, des);
    }
    for(int i = 0; i < q; i++)
    {
        if(niz1[i] == 1)
        {
            printf("DA\n");
        }
        else
        {
            printf("NE\n");
        }
}}