#include<bits/stdc++.h>

using namespace std;

 int main(void){
	
	int n;
	cin>>n;
	int q[n];
	for(int i=1;i<=n;i++){
		cin>>q[i];
	}
	int m;
	cin>>m;
	int p[m];
	int k[m];
	int y[m];
	for(int j=1; j<=m; j++){
		y[j]=0;
		cin>>p[j];
		cin>>k[j];
		for(int l=p[j];l<k[j]-1;l++){
			
			if(q[l]>q[l+1]){
				y[j]++;
			}
			
		}
		if(y[j]>1){
			cout<<"NE"<< endl;
			
		}
		else cout<<"DA"<< endl;
	}
	
		
	
	return 0;
}