#include <bits/stdc++.h>

using namespace std;

int niz[200000],dp[200000];
long long n,q;

string res(){
  long long l,r, suma = 0;
  cin >> l >> r;
  if(l == r) return "DA";
  
  for (int i = l ; i < r ; i++){
    suma+= dp[i];
    if(suma > 1) return "NE"; 
  }
  return "DA";
}

int main()
{
  cin >> n;
    
  for (int i = 0 ; i < n ; i++) cin >> niz[i];
  dp[0] = 0;
  for (int i = 1 ; i < n ; i++) 
    if(niz[i] < niz[i-1]) dp[i] = 1;
    else dp[i] = 0;

  cin >> q;
  
  while(q--){
    cout << res() << endl;
  }
  return 0;
}