#include<bits/stdc++.h>
using namespace std;
int n,nizn[200005],q,nizq[100005],l1,r1,nizn2[200005],br,l;
int main (){

    scanf("%d", &n);
    for (int i=1;i<=n;i++){
        scanf("%d", &nizn[i]);
    }
    scanf("%d", &q);
    for (int i=1;i<=q;i++){
            br=0;
        scanf("%d", &l1);
        scanf("%d", &r1);
        for (int j=l1;j<r1;j++){
                if(nizn[j]>nizn[j+1]){
                    br++;
                    if (br==2){
                        break;
                    }
                }
        }
        if (br<=1){
            printf("DA\n");
        }
        else{
            printf("NE\n");
        }
    }


return 0;
}