#include <bits/stdc++.h>
using namespace std;
#define ff(i,a,n) for(int i = a;i<n;++i)
int a[200005];
int pref[200005] = {0};
void solve(){
	int l, r;
	cin>>l>>r;
	l--;r--;
    int rez = pref[r]-pref[l];
	if(rez<2){
		cout<<"DA";
	}else{
		cout<<"NE";
	}
}
int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	int n;cin>>n;
	ff(i,0,n){
	cin>>a[i];
    }
    pref[0] = 0;
    ff(i,0,n){
    	pref[i+1] = pref[i];
	if(a[i]>a[i+1]){
		pref[i+1]++;
	}
    }
	int t;cin>>t;
		while(t--){
			solve();
			cout<<endl;
	    }
    
	return 0;
}