#include<bits/stdc++.h>
#define N 200001
using namespace std;
bool ifSort(int a[N], int l, int r){
	
	for(int i = l; i < r-1; i++){
		if(a[i - 1] > a[i]) return false;
	}
	return true;
}
bool check(int a[N], int n, int l, int r){
	int b[N];
	if (l == r) return true;
	for(int i = l - 1; i < r; i++){
		for(int j = l - 1; j < r ; j++){
			if(i > j){
				b[j] = a[j];
			}
			if(i < j){
				b[j-1] = a[j];
			}
			if(i == j) continue;
			if(ifSort(b, l, r)) return true;	
		}
		/*cout<<endl<<endl;
		for(int i = l-1; i < r; i++){
			cout<<b[i]<<" ";
		}
		cout<<endl<<"->"<<ifSort(b, l, r)<<" "<<endl;
		*/
		for(int i = l-1; i < r; i++){
			b[i] = 0;
		}
			
	}
	return false;
}
int main(){
	int a[N], b[N], l[N], r[N], n, m, x = 0, q;
	cin>>n;
	for(int i = 0; i < n; i++){
		cin>>a[i];
	}
	cin>>q;
	for(int i = 0; i < q; i++){
		cin>>l[i]>>r[i];
	}
	for(int I = 0; I < q; I++){	
		if(check(a, n, l[I], r[I])) cout<<"DA";
		else cout<<"NE";
		cout<<endl;
	}
	
	
	return 0;
}