#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{

    int n,q,i,x,y,j,z;
    cin>>n;
    int b[n];
    vector<int> a;
    cin>>x;
    for(i=1;i<n;i++){
        cin>>y;
        if(x>y){
            a.push_back(i);
            a.push_back(i+1);
        }
        b[i]=y;
        x=y;
    }
    cin>>q;
    for(i=0;i<q;i++){
        cin>>x>>y;
        z=0;
        for(j=0;j<a.size();j++){
            if(a[j]>=x){
                if(a[j]<=y){
                    if(a[j+1]==a[j]+1 && a[j+1]<=y){
                        if(b[a[j]-1]>b[a[j]+1] && b[a[j]]>b[a[j]+2]){
                            z=2;
                            break;
                        }
                        else{
                            z++;
                            j++;
                        }
                    }

                }
                else{
                    break;
                }
            }
            if(z>1){
                break;
            }
        }
        if(z>1){
            cout<<"NE\n";
        }
        else{
            cout<<"DA\n";
        }
    }
}