#include<bits/stdc++.h>

using namespace std;

int n;

bool provera(vector<int> &niz, int i, int r, int maks){
    while(i < r){
        if(niz[i] < maks) return false;
        maks = niz[i];
        i++;
    }
    return true;
}

bool resi(vector<int> &niz, int i, int r, int maks, int prosli){
    if(i == r) return true;
    if(niz[i] > maks) return resi(niz, i + 1, r, niz[i], maks);
    else{
        bool a = provera(niz, i + 1, r, maks);
        bool b;
        if(niz[i] < prosli) b = false;
        else b = provera(niz, i + 1, r, niz[i]);
    }
}

int main(){
    
    cin >> n;
    
    vector<int> niz(n);
    for(int i = 0; i < n; i++){
        cin >> niz[i];
    }
    
    int q;
    
    cin >> q;
    
    while(q--){
        int l, r;
        
        cin >> l >> r;
        cout << (resi(niz, l - 1, r, 0, 0) ? "DA" : "NE");
        cout << "\n";
    }
    
    return 0;
}