#include <stdio.h>
#include <stdlib.h>

int main(){

  int n, *P, i, x, a, b, j, brojac = 0, printano = 0;
  scanf("%d", &n);
  P = (int*) malloc(n*sizeof(int));

  for (i = 0; i < n; i++){
    scanf("%d", &P[i]);
  }

  scanf("%d", &x);
  for (i = 0; i<x; i++){
    scanf("%d%d", &a, &b);
    a-=1;
    b-=1;
    brojac = 0;
    printano = 0;

    for (j = a+1; j <= b; j+=2){
      if (P[j] <= P[j-1]) brojac++;
      if ((P[j] >= P[j+1]) && (j+1 <= b))  brojac++;

      if (brojac > 1){  
       printf("NE\n");
       printano = 1;
       break;
        }
      }
      if (printano == 0){
          printf("DA\n");
      }
    }

  return 0;
}