#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;
		
	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]) cout << "NE" << endl;
			
			else if(a[p] > a[p+1])
			{
				for(int j = p+1; j < k-1; j++)
				{
					if(p+1 ==  k-1)
					{
					  cout << "DA" << endl;
					  break;
					} 
					else
					{
						if(a[j] > a[p+1] || a[j] > a[k-1])
						{
							cout << "NE" << endl;
							break;
						}
						else cout << "DA" << endl;
					}
				}
			}
		} 
	}
	
	return 0;
}