#include <bits/stdc++.h>
using namespace std;
int a[100005];
bool p[100005];
bool r[100005];
int q,n;
int main(){
    cin>>n;

    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(i==1)r[i]=true;
        else if(a[i]>=a[i-1])r[i]=true;
        else r[i]=false;

        if(i==1)p[i]=true;
        else if(a[i]<=a[i-1])p[i]=true;
        else p[i]=false;
    }
    cin>>q;
    int x,y;
    while(q--){
        cin>>x>>y;
        int br1=0;
        int br2=0;
        for(int i=x;i<=y;i++){
            if(br1>2 and br2>2)break;
            if(p[i]==false)br1++;
            if(r[i]==false)br2++;
                }
        if(br1<2 or br2<2)cout<<"DA"<<endl;
        else cout<<"NE"<<endl;
        }

    return 0;
}