#include <bits/stdc++.h>

using namespace std;

int main()
{
  int niz[200001], dp[200001];
  long long n,q;
  
  cin >> n;
  niz[0] = -1;
  dp[0] = 0;
  for (int i = 1 ; i <= n ; i++) {
    cin >> niz[i];
    if(niz[i] >= niz[i-1]) dp[i] = dp[i - 1];
    else dp[i] = dp[i- 1] + 1;
  }
  cin >> q;
  
  while(q--){
    long long l, r;
    cin >> l >> r;
    if(dp[r] - dp[l] > 1) cout << "NE" << endl;
    else cout << "DA" << endl;
  }
  return 0;
}