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