#include <iostream>

using namespace std;

int main(int argc, char** argv) {
	
	int n;
	
	cin >> n;
	
	int a[n];
	
	for(int i = 0; i < n; i++) cin >> a[i];
	
	int q;
	
	cin >> q;
	
	int l[q], r[q];
	
	for(int i = 0; i < q; i++)
	{
		cin >> l[i] >> r[i];
	}
	
	int b[n] = {0};
	
	int j = 0;
	
	for(int i = 0; i < n - 1; i++)
	{
		if(a[i] > a[i+1] || a[i] > a[i+2])
		{
			b[j] = i;
			j++;
		} 
	}
	int res = 0;
	for(int i = 0; i < q; i++)
	{
		for(int k = 0; k < j; k++)
		{
			if(b[k] >= l[i] - 1 && b[k] < r[i] - 1) res++;
		}
		
		if(res > 1) cout << "NE" << endl;
		
		else cout << "DA" << endl;
		
		res = 0;
	}
	return 0;
}