#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
using namespace std;
const int maxN = 30010;


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

int main(void){
    solve();
    return 0;
}