#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

int main(){
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll n, q, i, j;
    cin >> n;
    vector <ll> a(n);
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    cin >> q;
    vector <bool> b(n);
    for(i=0;i<q;i++){
        ll x, y;
        bool m = false;
        bool p = true;
        cin >> x >> y;
        for(j=x-1;j<y-1;j++){
            //cout << a[j] << " ";
            if(a[j] > a[j+1]){
                if(m){
                    b[i] = false;
                    p = false;
                    break;
                }
                m = true;
            }
        }
        if(p){
            b[i] = true;
        }
        //cout << endl;
    }
    for(i=0;i<q;i++){
        if(b[i]){
            cout << "DA" << endl;
        }
        else{
            cout << "NE" << endl;
        }
    }
    return 0;
}