#include <math.h>
#include <stdio.h>

int main() {
  int N, Q, l, r;
  scanf("%d", &N);
  int niz[N], pom[N];
  for (int i = 0; i < N; i++) {
    scanf("%d", &niz[i]);
  }
  pom[0] = 0;
  int br = 0;
  for (int j = 1; j <= N - 1; j++) {
    if (niz[j - 1] > niz[j]) {
        br++;
    }
    pom[j] = br;
  }
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) {
    scanf("%d%d", &l, &r);
    if (pom[r - 1] - pom[l - 1] <= 1) {
      printf("DA\n");
    } else {
      printf("NE\n");
    }
  }
  return 0;
}