#include<stdio.h>
#include<vector>
#include<algorithm>

using namespace std;

const int MAX = 210;

int a[MAX];
int pref[MAX];
int cnt[MAX];

vector<int> neg;

int main()
{
    int n;

    scanf("%d", &n);

    for(int i = 1; i <= n; i++)
    {
        scanf("%d", &a[i]);

        if(i == 1)
        {
            pref[i] = a[i];
            cnt[i] = 0;
        }
        else
        {
            cnt[i] = cnt[i-1];
            pref[i] = a[i] - a[i-1];
            if(pref[i] < 0)
            {
                cnt[i]++;
                neg.push_back(i);
            }
        }

    }

    int q, l, r;
    scanf("%d", &q);

    for(int i = 0; i < q; i++)
    {
        scanf("%d%d", &l, &r);

        int negCnt = cnt[r] - cnt[l];

        if(negCnt > 1)
            printf("NE\n");
        else if(negCnt == 0)
            printf("DA\n");
        else
        {
            vector<int>::iterator y = upper_bound(neg.begin(), neg.end(), l);
            //printf("%d\n", *x);
            int x = *y;
            if(l > x-2)
                printf("DA\n");
            else if(r < x+1)
                printf("DA\n");
            else
            {
                if(a[x-2] <= a[x] || a[x-1] <= a[x+1])
                    printf("DA\n");
                else
                    printf("NE\n");
            }


        }


    }



    /*for(int i = 1; i <= n; i++)
        printf("%d ", pref[i]);
    printf("\n");


    for(int i = 1; i <= n; i++)
        printf("%d ", cnt[i]);
    printf("\n");

    for(int i = 0; i < neg.size(); i++)
        printf("%d ", neg[i]);
    printf("\n");*/


    return 0;
}