#include<bits/stdc++.h>

using namespace std;

int main(){
	long int n, q;
	cin >> n;
	long int a[n];	
	for (long int i = 0; i < n; i++)
		cin >> a[i];
	cin >> q;
	long int l[q], r[q];
	for (long int i = 0; i < q; i++){
		cin >> l[i];
		cin >> r[i];
	}
	
	for (long int i = 0; i < q; i++){
		long int k = 0, j = l[i] - 1;
		while (k < 2 && j < r[i] - 1){
			if (a[j] > a[j + 1])
				k++;	
			if (k == 2)
				break;
			j++;
		}
		if (k == 2)
			cout << "NE";
		else cout << "DA";
		
		if (i < q - 1) cout << endl;
	}
}