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

using namespace std;
typedef long long ll;


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

int main()
{
    ios_base::sync_with_stdio();cin.tie(NULL);cout.tie(NULL);
    ll n;
    cin>>n;
    ll a;
    for(int i=0;i<n;i++){
        cin>>a;
        v.push_back(a);
    }

    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";
   }



    return 0;
}