#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define ld long double
#define llinf 100000000000000000LL
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define pll pair<ll,ll>
#define endl '\n'
#define all(a) a.begin(),a.end()
#define sz(x) (int)x.size()
#define ios ios::sync_with_stdio(0); cout.tie(0); cin.tie(0);
//using namespace __gnu_pbds;
using namespace std;
//template<class T> using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const int MOD=1000000007;
const int mxN=2e5+5;
int arr[mxN],pref[mxN];
void solve(){
    int n;
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> arr[i];
    }
    pref[1]=0;
    for(int i=2;i<=n;i++){
        if(arr[i]<arr[i-1]){
            pref[i]=pref[i-1]+1;
        }
        else{
            pref[i]=pref[i-1];
        }
    }
    int q;
    cin >> q;
    int l,r;
    while(q--){
        cin >> l >> r;
        if(pref[r]-pref[l]>1){
            cout<<"NE\n";
        }
        else{
            cout<<"DA\n";
        }
    }
}

int main(){
    ios;
	int t=1;
	//cin >> t;
	while(t--){
       solve();
	}
    return 0;
}