#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define LPRINT(a, b) for (auto&(a) : (b))
#define li(i,a,b) for (int (i) = (a); (i) < (b); (i)++)
#define lij(i,a,b) for (int (i) = (a); (i) <= (b); (i)++)

int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n,q;
cin>>n;
vector<int> a(n);
li(i,0,n){
	cin>>a[i];
}
cin>>q;
li(i,0,q){
	int l, r;
	cin>>l>>r;
	l--;r--;
	bool z = true;
	for(int k = l+1; k<=r; k++){
		if(a[k]<a[k-1] && z){
			//da li mozemo da isecemo veci broj
			if(k == l+1 && z){
				if(a[k]<=a[k+1]){
					for(int p = k+1; p<=r; p++){
						if(a[p]<a[p-1]){
							cout<<"NE"<<endl;
							z = false;
							break;
						}
					}
				}
			} else {
				if(a[k]>=a[k-2] && a[k]<=a[k+1] && z){
					for(int p = k+1; p<=r; p++){
						if(a[p]<a[p-1]){
							cout<<"NE"<<endl;
							z = false;
							break;
						}
					}
				}
			}			
			//ili manji broj
			if(a[k-1]<=a[k+1] && z){
				for(int p = k+1; p<=r; p++){
					if(a[p]<a[p-1]){
						cout<<"NE"<<endl;
						z = false;
						break;
					}
				}
			}
		}
		if(!z) break;
	}
	if(z){

		cout<<"DA"<<endl;

	}
}
return 0;
}