#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define pii pair<int, int>
#define xx first
#define yy second
#define MAXN 200010

using namespace std;

int n, q, a[MAXN];
vector<int> gde;

int main()
{
    cin>>n;
    for (int i=1; i<=n; i++) cin>>a[i];

    for (int i=1; i<=n; i++) if (i>1 && a[i]<a[i-1]) { gde.pb(i); cout<<"ee "<<i<<endl; }

    cin>>q;
    while (q--)
    {
        int l, r; cin>>l>>r;
        auto it=upper_bound(gde.begin(), gde.end(), l);
        if (it==gde.end() || *it>r) { cout<<"DA"<<endl; continue; }
        int sta=*it;
        auto it2=upper_bound(gde.begin(), gde.end(), sta);
        if (it2==gde.end() || *it2>r)
        {
            //a[sta-1]<=a[sta+1]
            if (sta==(l+1) || sta==r) { cout<<"DA"<<endl; }
            else if (a[sta-1]<=a[sta+1]) { cout<<"DA"<<endl; }
            else { cout<<"NE"<<endl; }
        }
        else { cout<<"NE"<<endl; }
    }
}
/*
8
1 3 5 4 7 9 8 2

4 6
*/