#include <iostream>
#include <algorithm>

#define MAX_N 200000

int A[MAX_N];
int D[MAX_N];

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

		int mid = (left + right) / 2;

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

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

int main()
{
	int d = 0;

	int n;
	std::cin >> n;

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

		if (A[i - 1] > A[i])
			D[d++] = i - 1;
	}

	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 (d > dl + 1 && D[dl + 1] < r)		
			std::cout << "NE\n";
		else
			std::cout << "DA\n";		
	}

	return 0;
}