#include <bits/stdc++.h>
using namespace std;
int n,a[200005],q,l,r;
bool solve(int x,int y){
    bool rez=true;
    int br=0;
    if((y-x+1)==1 or (y-x+1)==2)return true;

    for(int i=x+1;i<=y;i++){
        if(a[i]<a[i-1]){
            if(i==x+1){
                if(a[i+1]>=a[i] or a[i+1]>=a[i-1]){
                    br++;
                }
                else{
                    rez=false;
                }
            }
            else if(i==y){
                br++;
            }
            else if((i-2)>=x and a[i-2]<=a[i]){
                br++;
            }
            else if((i+1)<=y and a[i+1]>=a[i-1]){
                br++;
            }
            else{
                rez=false;
                break;
            }
        }
    }
    if(br>1)rez=false;

    return rez;

}
int main(){
    scanf("%d", &n);
    for(int i=1;i<=n;i++){
        scanf("%d", &a[i]);
    }
    scanf("%d", &q);
    while(q--){
        scanf("%d%d", &l, &r);
        if(solve(l,r)){
            cout<<"DA"<<endl;
        }
        else{
            cout<<"NE"<<endl;
        }
    }


return 0;}