#include <bits/stdc++.h>
using namespace std;
int is_deletable(int l, int r, int a[], int n) {


    if(l==r)return 1;
    int sorted = 2;
    for (int i = l+1; i <= r; i++) {
        if (a[i] < a[i-1]) {
            sorted--;
            if(sorted==0)
                return -1;
        }
    }
    if (sorted<2) {
        return 1;
    }

    return 1;
}

int main() {
     int n;
   cin>>n;
   int a[n];
   for(int i=1; i <= n;i++)cin>>a[i];
   int q;
   cin>>q;
   while(q--){
    int l,r;
    cin>>l>>r;

    int deletable = is_deletable(l, r, a, n);
    if (deletable==1) {
        printf("DA\n");
    } else {
        printf("NE\n");
    }
   }

    return 0;
}