#include <iostream>
#include <vector>
using namespace std;
const int Nmax = 2e5;
const int Qmax = 1e5;
int niz[Nmax];
pair<int, int> nizQ[Qmax];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n, q;
	cin >> n;
	for (int i = 0; i < n; i++) cin >> niz[i];
	cin >> q;
	for (int i = 0; i < q; i++)
	{
		int li, ri;
		cin >> li >> ri;
		nizQ[i].first = li - 1;
		nizQ[i].second = ri - 1;
	}

	int* gazenja = new int[n];
	gazenja[n - 1] = -1;
	for (int i = n - 2; i >= 0; i--)
	{
		int j = i + 1;
		while (niz[j] >= niz[i] && j < n) j++;
		if (j != n) gazenja[i] = j;
		else gazenja[i] = -1;
	}

	for (int i = 0; i < q; i++)
	{
		int izmena = 0;
		for (int j = nizQ[i].first; j <= nizQ[i].second; j++)
		{
			if (gazenja[j] != -1 && gazenja[j] <= nizQ[i].second)
				if (++izmena == 2) break;
		}
		if (izmena == 2) cout << "NE\n";
		else cout << "DA\n";
	}

	delete[] gazenja;
}