#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;
	cin >> n;
	int a[n];
	for(int i = 0;i < n;i++)
		cin >> a[i];
	vector<int> v(n);
	v[0] = 1;
	for(int i = 1;i < n;i++) {
		if(a[i] >= a[i - 1])
			v[i] = v[i - 1] + 1;
		else
			v[i] = 1;
	}
	int q;
	cin >> q;
	while(q--) {
		int l, r;
		cin >> l >> r;
		--l, --r;
		int d = r - l + 1;
		if(v[r] >= d - 1 || v[r - 1] >= d - 1)
			cout << "DA\n";
		else {
			int x = r - v[r];
			if(v[x - 1] <= v[x + 1] && v[x - 1] + v[r] >= d - 1) 
				cout << "DA\n";
			else
				cout << "NE\n";
		}

	}
	return 0;
}