#include<bits/stdc++.h>
using namespace std;
int N,A[200009],Q,l,r,sol1,sol2,sol3;
int main(){
	cin>>N;
	for(int i=1; i<=N; i++)cin>>A[i];
	cin>>Q;
	for(int q=1; q<=Q; q++){
		cin>>l>>r;
		sol1=sol2=sol3=0;
		for(int i=l; i<=r; i++){
			if(A[i]>A[i+1] and i+1<=r)sol1+=1;
			if(A[i]>A[i+2] and i+2<=r)sol1+=2;
		}
		for(int i=l+1; i<=r; i++){
			if(A[i]>A[i+1] and i+1<=r)sol2+=1;
		}
		for(int i=l; i<=r-1; i++){
			if(A[i]>A[i+1] and i+1<=r-1)sol3+=1;
		}
		if(sol1>1 and sol2>0 and sol3>0)cout<<"NE"<<endl;
		else cout<<"DA"<<endl;
	}
	return 0;
}
/*
8
1 4 2 3 4 5 6 6
5
1 3
1 4
*/