#include<bits/stdc++.h>

using namespace std;

int main(){
	int n, q;
	cin >> n;
	int a[n];	
	for (int i = 0; i < n; i++)
		cin >> a[i];
	cin >> q;
	int l[q], r[q];
	for (int i = 0; i < q; i++){
		cin >> l[i];
		cin >> r[i];
	}
	
	for (int i = 0; i < q; i++){
		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;
	}
}