#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
	int n, q;
	cin >> n;
	vector<int>a(n);
	bool jedandva = true;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		if (a[i] != 1 && a[i] != 2) jedandva = false;
	}
	vector<pair<int, int>>gr;
	if (!jedandva) {
		int ll = 0, rr = 0, count = 0, indexveceg = 0;
		for (int i = 1; i < n; i++)
		{
			if (a[i - 1] > a[i]) {
				count++; if (count == 1) indexveceg = i;
			}
			if (count == 2) {
				rr = i - 1;
				gr.push_back({ ll, rr });
				i = indexveceg;
				ll = indexveceg;
				count = 0;
			}
		}
		gr.push_back({ ll, n - 1 });
	}
	else
	{
		int ll = 0, rr = 0, count = 0, indexveceg = 0, veci = a[0];
		for (int i = 1; i < n; i++)
		{
			if (veci > a[i]) { count++; if (count == 1) indexveceg = i; }
			else veci = max(veci, a[i]);
			if (count == 2)
			{
				rr = i - 1;
				gr.push_back({ ll, rr });
				i = indexveceg;
				ll = indexveceg;
				count = 0;
			}
		}
		gr.push_back({ ll, n - 1 });
	}
	cin >> q;
	for (int qq = 0; qq < q; qq++)
	{
		int l, r; cin >> l >> r;
		l--; r--;
		if (abs(l - r) < 2) cout << "DA" << endl;
		else
		{
			string rez = "NE";
			for (int i = 0; i < gr.size(); i++)
			{
				if (l >= gr[i].first && r <= gr[i].second) {
					rez = "DA";
					break;
				}
				else if (l < gr[i].first) break;
			}
			cout << rez << endl;
		}
	}
}