#include <bits/stdc++.h>
#define ll long long
#define MAXN 200010
using namespace std;
ll a[MAXN],pref[MAXN];
bool pret[MAXN];
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll n,q,l,r;
    cin >> n;
    a[0]=LLONG_MIN;
    for (ll i=1;i<=n;i++)
    {
        cin >> a[i];
        if (a[i]<a[i-1])
            pret[i]=true;
        pref[i]=pref[i-1]+pret[i];
    }
    cin >> q;
    while (q--)
    {
        cin >> l >> r;
        cout << (pref[r]-pref[l-1]-pret[l]>1?"NE\n" : "DA\n");
    }
    return 0;
}