#include <bits/stdc++.h>
using namespace std;
long long n,a[200005],q,x,y,niz[200005],ps[200005];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		scanf("%lld",&a[i]);
		if(i==1)continue;
		if(a[i-1]<a[i])niz[i-1]=1;
		else niz[i-1]=0;
		ps[i-1]=niz[i-1];
	}
	for(int i=1;i<=n;i++){
		ps[i]=ps[i]+ps[i-1];
	}
/*	cout<<endl;
	for(int i=1;i<=n;i++){
		cout<<niz[i]<<" ";
	}
	cout<<endl;*/
	cin>>q;
	for(int i=1;i<=q;i++){
		scanf("%lld %lld",&x,&y);
		if(ps[y]-ps[x]>1)cout<<"NE"<<endl;
		else cout<<"DA"<<endl;
	}


return 0;
}