#include <bits/stdc++.h>

using namespace std;

int lowerbound(vector<int> b, int s,int bsize){
	int l(0), d(bsize), ss;
	
	while(l <= d){
		ss = l + (d-l)/2;
		if(b[ss] > s){
			
			d = ss-1;	
		}else if(b[ss]< s){
			l = ss+1;
			
		}else{
			return s;
		}
		
		
	}
	
	if(l < bsize){
		
		return b[l];
	}else{
		return 0;
	}
	
}




int main(){
	int n, i, q,x,y;
	cin>>n;
	vector<int> a(n), b;
	for(i = 0; i <n; i++){
		cin>>a[i];
	}
	cin>>q;
	
	vector<int> l(q), r(q);
	
	for(i = 0; i < q; i++){
		cin>>l[i]>>r[i];
	}
	
	for(i = 0; i < n-1; i ++){
		if(a[i] > a[i+1]){
			b.push_back(i+1);
		}	
		
	}
	
	for(i = 0; i < q; i ++){
		x = lowerbound(b, l[i], b.size());
	//	cout<<x<<" ";
		if(x == 0){
			cout<<"DA\n";
			}else{
				if(x < r[i]){
					
						y = lowerbound(b,x+1, b.size());
						//cout<<y<<" ";
						if(y == 0){
							cout<<"DA\n";
						}else{
						
						
						if(y < r[i]){
							cout<<"NE\n";
						}else{
							cout<<"DA\n";
					
						}
					}
			
		}else{
		//	cout<<"DA\n";
		}
	}
}






return 0;
}