#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
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];
    for(ll i = 1;i<n;i++) p[i] = p[i-1] + (a[i]>a[i+1]);
    for(ll i = 2;i<n;i++) p2[i] = p2[i-1] + ((a[i-1]>a[i])&&a[i]==a[i+1]);
    cin >> q;
    while(q--){
        ll l,r; cin >> l >> r;
        ll sum = p[r-1] - p[l-1];
        if(sum<=1){
            if(r-1>=l+1&&p2[r-1]-p2[l+1]>=1) cout<<"NE"<<endl;
            else cout<<"DA"<<endl;
        }
        else cout<<"NE"<<endl;
    }
    return 0;
}
/**
4
2 2 1 1
3
1 3
2 4
1 4


**/