#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 = n-1; i > -1; --i){
        for(int j = i-1; j > -1; --j){
            if(a[j] <= a[i]) continue;
            for(int k = j+1; k <= i; ++k) fl[k] = j;
            i = j+1;
            break;
        }
    }

    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;
}