#include <bits/stdc++.h>
using namespace std;
int n,a[200005],q,l,r;
bool solve(int x, int y){
    rez=true;
    br=0;
    for(int i=x;i<=y;i++){
        if(a[i]<a[i-1] and a[i+1]<a[i] and i!=y){
            rez=false;
            break;
        }
        else if(a[i]<a[i-1] and a[i+1]==a[i] and i!=y){
            rez=false;
            break;
        }
        else if(a[i]<a[i-1] and a[i+1]>a[i] and a[i+1]<a[i-1] and i!=y){
            rez=false;
            break;
        }
        else if(a[i]<a[i-1] and a[i-1]==a[i+1] and i!=y){
            br++;
        }
        else if(a[i]<a[i-1] and a[i+1]>a[i-1] and i!=y){
            br++;
        }
    }
    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;}