#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];
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]);
    cin >> q;
    while(q--){
        ll l,r; cin >> l >> r;
        ll sum = p[r-1] - p[l-1];
        if(sum<=1) cout<<"DA"<<endl;
        else cout<<"NE"<<endl;
    }
    return 0;
}