#include <bits/stdc++.h>

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;

    cin >> n;
    
    vector<int> a(n);
    vector<vector<int>> pv(n+1);

    for(int i = 0; i < n; ++i) cin >> a[i], pv[a[i]].push_back(i);

    vector<int> fl(n, -1);
    set<int> av;

    for(int i = n; i > -1; --i){
        for(int j = 0; j < (int) pv[i].size(); ++j){
            if(av.empty()) continue;
            auto pposit = av.lower_bound(pv[i][j]);
            pposit = prev(pposit);
            fl[pv[i][j]] = *pposit;
        }
        for(int j = 0; j < (int) pv[i].size(); ++j) av.insert(pv[i][j]);
    }

    int q;

    cin >> q;

    while(q--){
        int l, r;

        cin >> l >> r;
        --l, --r;

        if(fl[r] <= l) { cout << "DA\n"; continue; }
        if(fl[r] == 0) { cout << "DA\n"; continue; }
        if(a[fl[r]-1] <= a[fl[r]+1] && fl[fl[r]-1] < l ) { cout << "DA\n"; continue; }
        if(fl[r-1] < l) { cout << "DA\n"; continue; }
        
        cout << "NE\n";
    }
    return 0;
}