#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair

typedef long long ll;
typedef long double ld;

const ll mn=300200;
ll a[mn];
ll pom[mn];
ll pref[mn];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll n;
    cin>>n;
    for(ll i=0;i<n;i++) cin>>a[i];
    for(ll i=0;i<n-1;i++)
    {
        if(a[i]>a[i+1]) pom[i]=1;
        else pom[i]=0;
    }
    pom[n-1]=0;
    pref[0]=pom[0];
    for(ll i=1;i<n;i++) pref[i]=pref[i-1]+pom[i];
    ll q;
    cin>>q;
    while(q--)
    {
        ll l,r;
        cin>>l>>r;
        l--; r--;
        if(l==r) cout<<"DA\n";
        else if(l==0)
        {
            r--;
            if(pref[r]>1) cout<<"NE\n";
            else cout<<"DA\n";
        }
        else
        {
            l--;
            r--;
            if(pref[r]-pref[l]>1) cout<<"NE\n";
            else cout<<"DA\n";
        }
    }
}