#include<iostream>
using namespace std;
 int main(){
    int n, q;
    cin >> n;
    int niz[n];
    for (int i=0;i<n;i++){
        cin >> niz[i];
    }
    cin >> q;
    int kriticni[n];
    for (int i=0;i<n;i++){
        kriticni[i]=-10;
    }
    for (int i=1;i<n;i++){
        if (niz[i]<niz[i-1]) {kriticni[i-1]=i+1;}
    }
    int l,r;
    int x;
    for (int i=0;i<q;i++){
        x=0;
        cin >> l >> r;
        for (int j=0;j<n;j++){
            if (kriticni[j]> l && kriticni[j]<=r){
                x=x+1;
            }
            if (x>1) {break;}
        }
        if (x<=1) {cout << "DA" << "\n";}
        else {cout << "NE" << "\n";}
    }
    return 0;
    
           
    
 }