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