#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int prev=0;
    int a[200010];
    a[0]=0;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        if(x<prev){
            a[i+1]=a[i]+1;
        }
        else{
            a[i+1]=a[i];
        }
        prev=x;
    }
    int q;
    cin>>q;
    for(int i=0;i<q;i++){
        int x,y;
        cin>>x>>y;
        if(a[y]-a[x]<=1){
            cout<<"DA"<<endl;
        }
        else{
            cout<<"NE"<<endl;
        }
    }
    return 0;
}