#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;
   psuma[0]=0;
   for (int i=1;i<=n;i++){
      cin >> niz[i];
      if(niz[i-1]>niz[i]){
         greske[i]++;
         psuma[i]=psuma[i-1]+1;
      }
      else psuma[i]=psuma[i-1];
      
   }

   cin >> q;
   for (int j=1;j<=q;j++){
      br=0;
      cin >> l >> r;
      if((psuma[r]-psuma[l])>1)cout <<"NE\n";
      else cout <<"DA\n";
   }
   return 0;
}