#include<bits/stdc++.h>
using namespace std;
int n,q,niz[200005],l,r,br,psuma[200005],greske[200005];
int main(){
   cin >> n;
   niz[0]=0;
   for (int i=1;i<=n;i++){
      cin >> niz[i];
      if(niz[i-1]>niz[i]){
         greske[i]=1;
      }
   }
   cin >> q;
   for (int j=1;j<=q;j++){
      cin >> l >> r;
      for(int i=l;i<=r;i++){
         if(greske[i]>=1)br++;
      }
      if(br>1)cout <<"NE\n";
      else cout <<"DA\n";
   }
   return 0;
}