#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define ceri(a,l_,r_) {for(ll i_ = l_;i_<=r_;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
using namespace std;
#define maxn 200005
ll n,q;
ll a[maxn];
ll p[maxn],p2[maxn];
int main()
{
    ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); cerr.tie(0);
    cin >> n;
    for(ll i = 1;i<=n;i++) cin >> a[i];
    set<ll> s;
    for(ll i = 1;i<n;i++){
        p[i] = p[i-1] + (a[i]>a[i+1]);
        if(a[i]>a[i+1]) s.insert(i);
    }
    cin >> q;
    while(q--){
        ll l,r; cin >> l >> r;
        ll sum = p[r-1] - p[l-1];
        if(sum==0) cout<<"DA"<<endl;
        else if(sum==1){
            ll i = *s.lower_bound(l);
            if(i==l||i==r-1) cout<<"DA"<<endl;
            else{
                if(a[i-1]<=a[i+1]) cout<<"DA"<<endl;
                else if(a[i]<=a[i+2]) cout<<"DA"<<endl;
                else cout<<"NE"<<endl;
            }
        }
        else cout<<"NE"<<endl;
    }
    return 0;
}
/**
4
2 2 1 1
3
1 3
2 4
1 4


**/