#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]=ps[i-2]+niz[i-1];
	}
	if(a[n]<a[n-1])niz[n]=1;
	else niz[n]=0;
	ps[n]=ps[n-1]+niz[n];
	cin>>q;
	for(int i=1;i<=q;i++){
		scanf("%lld %lld",&x,&y);
	//	cout<<"niz[y] "<<niz[y]<<" razlika "<<ps[y]-ps[x-1]<<endl;
		if(niz[y]==0 and ps[y]-ps[x-1]>1)cout<<"NE"<<endl;
		else cout<<"DA"<<endl;
	}
	/*for(int i=1;i<=n;i++){
		cout<<ps[i]<<" ";
	}
	cout<<endl;
	for(int i=1;i<=n;i++){
		cout<<niz[i]<<" ";
	}
	cout<<endl;*/


return 0;
}