#include <iostream>
 
 using namespace std;
 
 string f(int k, int a[], int l, int r){
 	int c = 0;
 	for (int i = 0; i < k; i++){
 		if ((a[i] <= r) and (a[i] > l)){
 			c++;
		 }
		if (c == 2) return "NE";
	 }
	return "DA";
 }
 
 int main(){
 	int n, x, y, k=0;
 	cin >> n;
 	int a[200000];
 	cin >> y;
 	for (int i = 1; i < n; i++){
 		cin >> x;
 		if (y > x) a[k] = i;
 		y = x;
 		k++;
	}
	int q;
	cin >> q;
	int l[100000], r[100000];
	for (int i = 0; i < q; i++){
		cin >> l[i] >> r[i];
	}
	for (int i = 0; i < q; i++){
		cout << f(k, a, l[i]-1, r[i]-1) << endl;
	}
 }