#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] >> r[i];
	
	long int x[n];
	x[0] = 1;
	
	for (long int i = 1; i < n; i++)
		if (a[i - 1] > a[i])
			x[i] = x[i - 1]; 
		else x[i] = x[i - 1] + 1;
		
	/*for (long int i = 0; i < n; i++)
		cout << x[i] << " ";	
	cout << endl;*/
	
	for (long int i = 0; i < q; i++){
		
		if (x[r[i] - 1] - x[l[i] - 1] + (r[i] - l[i]) %  2 <= 2)
			cout << "DA";
		else cout << "NE";
		if (i < q - 1)
			cout << endl;
	}
}