#include <bits/stdc++.h>
#define maxn 200002

using namespace std;
typedef long long ll;


ll dp[maxn];
vector<ll> v;
vector<pair<ll, ll>> jd;

int main()
{
    ios_base::sync_with_stdio();cin.tie(NULL);cout.tie(NULL);
    ll n;
    cin>>n;
    ll a;
    bool o=true;
    for(int i=0;i<n;i++){
        cin>>a;
        v.push_back(a);
        if(a != 1 && a!=2)
            o = false;
    }
    if(o == true){
    if(v[1]>=v[0])
        dp[1]=0;
    else
        dp[1]=1;

    for(int i=2;i<n;i++)
        if(v[i]<v[i-1])
            dp[i]=dp[i-1]+1;
        else
            dp[i]=dp[i-1];

   //for(int i=0;i<n;i++) cout<<dp[i]<<" ";

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

    }
    else
    {
        ll q, l, r, br=1, i=0;
        ll maxniz=0;
        cin>>q;
        bool ispis = false;
    bool obrisan = false;
    for(int i=0;i<q;i++){
        obrisan = false;
        ispis = false;
        cin>>l>>r;
        obrisan = false;
        ispis = false;
        for(int j=l;j<r;j++){
            if(obrisan == true && v[j]<v[j-1]){
                cout<<"NE\n";
                ispis = true;
                break;
            }
            if(v[j]<v[j-1])
                obrisan = true;
        }
        if(ispis == false){
            cout<<"DA\n";
        }
    }

    return 0;
}