#include<bits/stdc++.h>
using namespace std;
int n,nizn[200005],q,nizq[100005],l1,r1,nizn2[200005],br,l;
int main (){
    cin>>n;
    for (int i=1;i<=n;i++){
        cin>>nizn[i];
    }
    cin>>q;
    for (int i=1;i<=q;i++){
            br=0;
        cin>>l1>>r1;
        int razlika=r1-l1;
        for (int j=l1;j<r1;j++){
            if (nizn[j]>nizn[j+1]){
                    l=j;
                for (int k=l1;k<r1;k++){
                    if (k==l){
                        l=0;
                        k--;
                        continue;
                    }
                    if (l!=0){
                    nizn2[k]=nizn[k];
                    }
                    else{
                        nizn2[k]=nizn[k+1];
                    }
                }
            }
        }
        for (int j=l1;j<r1-1;j++){
            if (nizn2[j]>nizn2[j+1]){
                br++;
                break;
            }
        }
        if (br>0){
            cout<<"NE"<<endl;
        }
        else{
            cout<<"DA"<<endl;
        }
    }



return 0;
}