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

int _lis(int arr[], int n, int *max_ref) {
  if (n == 1)
    return 1;
  int res, max_ending_here = 1;

  for (int i = 1; i < n; i++) {
    res = _lis(arr, i, max_ref);
    if (arr[i - 1] <= arr[n - 1] && res + 1 > max_ending_here)
      max_ending_here = res + 1;
  }

  if (*max_ref < max_ending_here)
    *max_ref = max_ending_here;
  return max_ending_here;
}

int lis(int arr[], int n) {
  int max = 1;
  _lis(arr, n, &max);
  return max;
}

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