#include <bits/stdc++.h>
using namespace std;


bool check(int arr[], int n, int levi, int desni)
{

    int count = 0;
    int index = -1;
    for (int i = 1+ levi; i < desni; i++) {
        if (arr[i - 1] > arr[i]) {


            count++;

            index = i;
        }
    }


    if (count > 1)
        return false;

    if (count == 0)
        return true;

    if (index == desni - 1 || index == 1)
        return true;

    if (arr[index - 1] < arr[index + 1])
        return true;

    if (index - 2 >= 0 && arr[index - 2] < arr[index])
        return true;

      if(index < 0)
          return true;

    return false;
}

int main()
{
    int n, q, lev, des;
    scanf("%d", &n);
    int arr[n];
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    scanf("%d", &q);
    bool niz1[q];
    for(int i = 0; i < q; i++)
    {
        scanf("%d%d", &lev, &des);
        niz1[i] = check(arr, n, lev, des);
    }
    for(int i = 0; i < q; i++)
    {
        if(niz1[i])
        printf("DA\n");
        else{
            printf("NE\n");
        }


    }


    return 0;
}