#include <iostream>
#include <algorithm>

#define MAX_N 200000
#define MAX_Q 100000

unsigned A[MAX_N];
unsigned D[MAX_N]; 
char S[MAX_N]; 

unsigned bs_firstGreaterOrEqual(unsigned* first, unsigned* last, unsigned val)
{
	unsigned left = 0;
	unsigned right = last - first - 1;
	unsigned out;
	while (true)
	{
		if (right == left)					
			break;		

		unsigned mid = (left + right) / 2;

		if (first[mid] < val)
			left = mid + 1;
		else
			right = mid;
	}

	if (first[left] < val)
		return last - first;
	if (left == 0 && first[left] != val)
		return 0;
}

int main()
{
	int d = 0;

	int n;
	std::cin >> n;
	
	for (int i = 0; i < n; ++i)	
		std::cin >> A[i];

	for (int i = 0; i < n - 1; ++i)
		if (A[i] > A[i + 1])
		{
			D[d] = i;
			S[d] = 0;
			if (i > 0 && A[i - 1] <= A[i + 1]) //Moze levi da se izbrise
				S[d] |= 1;
			if (i + 2 < n && A[i] <= A[i + 2]) //Moze desni da se izbrise
				S[d] |= 2;
			d++;
		}

	int q;
	std::cin >> q;

	for (int i = 0; i < q; ++i)
	{
		int l, r;
		std::cin >> l >> r;
		--l;
		--r;

		int dl = bs_firstGreaterOrEqual(D, D + d, l);		

		if (dl == d)
		{
			std::cout << "DA\n";
			continue;
		}

		bool imaBarDvaPada = d > dl + 1 && D[dl + 1] < r;
		bool naLevojIviciIMozeDaSeObrise = D[dl] == l;// && (S[dl] & 1);
		bool naDesnojIviciIMozeDaSeObrise = D[dl] == r - 1;// && (S[dl] & 2);
		bool nijeNaIviciIMozeDaSeObrise = S[dl] != 0 && D[dl] != l && D[dl] != r - 1;
		bool nemaPad = D[dl] < r;
		if (imaBarDvaPada || !(naLevojIviciIMozeDaSeObrise || naDesnojIviciIMozeDaSeObrise || nijeNaIviciIMozeDaSeObrise))
			std::cout << "NE\n";				
		else
			std::cout << "DA\n";			
	}	

	return 0;
}