#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 sorted(vector<long long> v){
	bool ok=true;
	for(long long i=0;i<v.size()-1;i++){
		if(v[i+1]<v[i]){
			//cout<<i+1<<" "<<i<<endl;
			ok=false;
		}
	}
	return ok;
}

bool poslednji(vector<long long> v, long long a, long long b){
	if(a==b){
		return true;
	}
	for(long long j=a;j<=b;j++){
			vector<long long> pom;
			for(long long k=a;k<=b;k++){
				if(k!=j){
					pom.push_back(v[k]);
				}
			}
			for(long long k=0;k<pom.size();k++){
				//cout<<pom[k]<<" ";
			}
			//cout<<endl;
			if(sorted(pom)){
				return true;
			}
		}
	return false;
}

int main(int argc, char** argv) {
	vector< long long> v;
	ios_base::sync_with_stdio(false);
	long long n,k,q,a,b;
	cin>>n;
	v.push_back(0);
	for(long long i=0;i<n;i++){
		cin>>k;
		v.push_back(k);
	}
	cin>>q;
	for(long long i=0;i<q;i++){
		cin>>a>>b;
		bool ok=true;
		ok=poslednji(v,a,b);
		if(ok){
			cout<<"DA"<<endl;
		}
		else{
			cout<<"NE"<<endl;
		}
		
	}
	return 0;
}

/*
7
1 5 4 6 7 8 6
1
1
7
*/