#include <bits/stdc++.h>
using namespace std;

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

    int A[n];

    for(int i = 0;i < n;i++){
        scanf("%d", &A[i]);
    }

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

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

    int konfl[n], konfd[n];

    for(int i = 1; i < n-1;i++){
        if(A[i] > A[i+1])
            konfd[i] = 1;
        else
            konfd[i] = 0;

        if(A[i-1] > A[i])
            konfl[i] = 1;
        else
            konfl[i] = 0;
    }

    konfl[0] = 0;
    if(A[0] > A[1])
        konfd[0] = 1;
    else
        konfd[0] = 0;

    konfd[n-1] = 0;
    if(A[n-2] > A[n-1])
        konfl[n-1] = 1;
    else
        konfl[n-1] = 0;


    int br, duz;
    for(int i = 0;i < q;i++){
        br = 0; duz = 0;

        if(r[i] - l[i] < 2)
            br = 1;
        else{
            int j = l[i] - 1;

            while((j < r[i]) && konfd[j]){
                j++;
                br++;
                if(br > 1)
                    break;
            }

            if(br > 1){
                printf("NE\n");
                continue;
            }


            while(j < r[i]){
                if(konfd[j] && j != r[i] - 1){
                    if(A[j] <= A[j+2]){
                        j++;
                        duz++;
                    }
                    else{
                        duz = 0;
                    }
                    br++;
                }
                else{
                    duz++;
                }
                j++;
            }
        }

        if(br > 1){
            printf("NE\n");
        }
        else
            printf("DA\n");

    }

    return 0;
}