#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);

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

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

    for(int i = 0; i < n; ++i){
        for(int j = i+1; j < n; ++j){
            if(a[i] <= a[j]) { i = j-1; break; }
            fl[j] = i;
        }
    }

    int q;

    cin >> q;

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

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

        if(fl[r] < l || l == r) { cout << "DA\n"; continue; }
        if(fl[r] == l || 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; }
        cout << "NE\n";
    }
    return 0;
}