#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> pref(n);
  for (int i = 0; i + 1 < n; i++) {
    if (i > 0) {
      pref[i] = pref[i - 1];
    }
    if (a[i] > a[i + 1]) {
      pref[i]++;
    }
  }
  auto GetSum = [&](int l, int r) {
    if (l == r) {
      return 0;
    }
    r--;
    int s = pref[r];
    if (l > 0) {
      s -= pref[l - 1];
    }
    return s;
  };
  vector<int> f(n);
  for (int i = 0; i < n; i++) {
    int ptr = i;
    while (ptr + 1 < n && a[ptr + 1] >= a[ptr]) {
      ptr += 1;
    }
    for (int j = i; j <= ptr; j++) {
      f[j] = ptr;
    }
    i = ptr;
  }
  vector<int> p(n);
  for (int i = 0; i < n; i++) {
    if (f[i] >= n - 2) {
      p[i] = n - 1;
    } else {
      if (a[f[i]] <= a[f[i] + 2]) {
        p[i] = f[f[i] + 2];
      } else {
        p[i] = f[i] + 1;
      }
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    --l; --r;
    if (l == r) {
      cout << "DA" << '\n';
      continue;
    }
    cout << ((p[l] >= r || f[l + 1] >= r) ? "DA" : "NE") << '\n';
    continue;
    if (l == r || l + 1 == r) {
      cout << "DA" << '\n';
      continue;
    }
    if (a[l] <= a[l + 2] && GetSum(l + 2, r) == 0) {
      cout << "DA" << '\n';
      continue;
    }
    if (GetSum(l + 1, r) == 0) {
      cout << "DA" << '\n';
      continue;
    }
    int s = GetSum(l, r);
    if (s > 1) {
      cout << "NE" << '\n';
    } else {
      cout << "DA" << '\n';
    }
  }
  return 0;
}