#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int n, q, x, y;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	cin >> q;
	for(int i = 0; i < q; i++) {
		int z[y-x+1], z1[y-x], z2[y-x], o = 0, sv = 0;
		bool sb = true;
		cin >> x >> y;
		for(int j = 0; j <= y-x; j++) {
			z[j] = a[j+x-1];
		}
		for(int j = 0; j <= y-x; j++) {
			o = 0;
			for(int k = 0; k <= y-x; k++) {
				if(j != k) {
					z1[o] = z[k+x-1];
					o++;
					z2[o] = z1[o];
				}
			}
			sort(z2, z2 + y-x);
			for(int k = 0; k < y-x; k++) {
				if(z1[k] != z2[k]) {
					sv++;
					break;
				}
			}
		}
		if(sv == y-x+1) {
			sb = false;
		}
		if(sb) {
			cout << "DA" << endl;
		}else{
			cout << "NE" << endl;
		}
	}
	
	return 0;
}