#include<iostream>
#include<vector>

using namespace std;

int mz(vector<int>& b,int l,int r){
if(l==r)return 0;
else if(b[l]>b[l+1])return 1+mz(b,l+1,r);
else return mz(b,l+1,r);
}
int main(){
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
unsigned int n,q,l,r;
cin>>n;
vector<int> niz(n+1);
for(int i=1;i<=n;i++){
    cin>>niz[i];
}
cin>>q;
for(int i=0;i<q;i++){
    cin>>l>>r;
    if(mz(niz,l,r)>1)cout<<"NE"<<endl;
    else cout<<"DA"<<endl;
}
return 0;
}