#include <bits/stdc++.h>
#include <iostream>
using namespace std;

struct par{
	int levi, desni;
};

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

bool dobar(vector<int> v){
	int br=0;
	for(int i=0;i<v.size();i++){
		if(v[i]>1){
			br++;
		}
		if(br>1){
			return false;
		}
	}
	return true;
}

int main(int argc, char** argv) {
	vector< int> v;
	int n,k;
	cin>>n;
	v.push_back(0);
	for(int i=0;i<n;i++){
		cin>>k;
		v.push_back(k);
	}
	int q, a, b;
	cin>>q;
	for(int i=0;i<q;i++){
		cin>>a>>b;
		vector<int> pom;
		for(int j=a;j<=b;j++){
			int brm=0;
			for(int k=j+1;k<=b;k++){
				if(v[k]<v[j]){
					brm++;
				}
			}
			pom.push_back(brm);
		}
		bool ok=dobar(pom);
		if(ok){
			cout<<"DA"<<endl;
		}
		else{
			cout<<"NE"<<endl;
		}
	}
	return 0;
}