#include <iostream>
using namespace std;

int brojBrisanja(int *niz, int len, int l, int r) {
  int broj = 0;
  if (len > 1 && r > l)
    for (int i = l - 1; i < r - 1; i++)
      if (niz[i] > niz[i + 1])
        broj++;
  return broj;
}

int main() {
  int N;
  cin >> N;
  int glavni[N];
  for (int i = 0; i < N; i++)
    cin >> glavni[i];
  int Q;
  cin >> Q;
  int l[Q];
  int r[Q];
  for (int i = 0; i < Q; i++) {
    cin >> l[i];
    cin >> r[i];
  }
  for (int i = 0; i < Q; i++) {
    if (brojBrisanja(glavni, N, l[i], r[i]) < 2)
      cout << "DA" << endl;
    else
      cout << "NE" << endl;
  }
}