#include <iostream>

typedef long long ll;
using namespace std;

int main ()
{
	ll N;
	cin>> N;
	ll A[N];
	for (ll i = 0; i<N; i++) cin>>A[i];
	ll Q;
	cin>>Q;
	ll r,l;
	ll nasla;
	bool radi;
	string ispis [Q];
	for (ll i = 0; i<Q; i++)
	{   cin>> l >> r;
		if ( r-l <=1) ispis[i] = "DA";
		else
		{   radi = true;
			nasla = 0;
			for (ll j = l-1; j<r-1 && radi; j++)
			{
				if(A[j] > A[j+1])
				{
					nasla ++;
					if (nasla == 2){ ispis[i] = "NE"; radi = false;	}
					else if (j == r-2) ispis[i] = "DA";
					else if (j>l-1 && A[j-1] > A[j+1])
					{
					    if (j+2 <= r-1) {ispis [i] = "NE"; radi = false;}
						else if ( j+2 < r && A[j] > A[j+2]) {ispis [i] = "NE"; radi = false;}
					}
				}
				else if (j == r-2) ispis[i] = "DA";
			}
		}
	}
	for (ll i = 0; i<Q; i++)
		cout<< ispis[i]<<endl;


	return 0;
}