#include <iostream>


using namespace std;

struct poklon
{
	int l;
	int r;
};

int main()
{
	int n;
	cin >> n;
	
	int a[n];
	
	for(int i = 1; i <= n; i++)
		cin >> a[i];

	int q;
	cin >> q;
	
	poklon b[q];
	for(int i = 0; i < q; i++)
		cin >> b[i].l >> b[i].r;
		
	int ind = 0;
	
	bool ans = true;
		
	for(int i = 0; i < q; i++)
	{
		ind = 0;
		
		if((b[i].r - b[i].l) <= 2)
			cout << "DA" << endl;
			
			
		else
		{
			int p = b[i].l, k = b[i].r;
			
			if(a[k] < a[k-1] || a[p] > a[p+1]) ind++;
			
			for(int j = k-1; j > p+1; --j)
			{
			  if(a[j] < a[j-1] && ind == 1)
			  {
			     ans = false;
			     break;
			  }
			} 

			
		    if(ans)
				cout << "DA" << endl;
			
			else
				cout << "NE" << endl;
		} 
	}
	
	return 0;
}