#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);
    }
    ll q, l, r;
    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;
}