#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;
        if (pref[r]-pref[l]>1)
        {
            cout << "NE\n";
            continue;
        }
        if (pref[r]-pref[l]==0 || r-l+1<=2)
        {
            cout << "DA\n";
            continue;
        }
        ll L=l,R=r,mid,pos;
        while (L<=R)
        {
            mid=(L+R)/2;
            if (pref[mid]-pref[l]==1)
            {
                pos=mid;
                R=mid-1;
            }
            else
                L=mid+1;
        }
        if (pos==l+1 || pos==r || a[pos+1]>=a[pos-1] || a[pos]>=a[pos-2])
        {
            cout << "DA\n";
            continue;
        }
        cout << "NE\n";
    }
    return 0;
}