#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++){
      cin >> l >> r;
      br=(r-l)*(r-a-1)/2;
      if(niz[r]-niz[l]<br)cout <<"NE\n";      
      else cout <<"DA\n";
   }
   return 0;
}