#include<bits/stdc++.h>
using namespace std;

void funk(){
    bool i=false;
    for(int j=a+1; j<=b; j++){
        if(A[j]<A[j-1]){
            if(i){
                cout << "NE" << "\n";
                return;
            }
            else{
                if(j==b){
                    cout << "DA" << "\n";
                    return;
                }
                if(j==a+1) i=true;
                else if(A[j]>=A[j-2] or A[j-1]<A=[j+1]) i=true;
                else{
                    cout << "NE" << "\n";
                    return;
                }
            }
        }
    }
    cout << "DA" << "\n";
}
int main(){
    scanf("%d", &n);
    for(int i=1; i<=n; i++){
        scanf("%d", &A[i]);
    }
    scanf("%d", &q);
    for(int i=1; i<=q; i++){
        cin >> a >> b;
        if(a==b or b-a==1) cout << "DA" << "\n";
        else funk();
    }
    return 0;
}