#include <bits/stdc++.h>

using namespace std;

int n, a[200002];
int q;
int l, r;
int b[200002];
int neVazi [200002];

using namespace std;

int main()
{
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(false);

    cin >> n;
    cin >> a[0];
    int j=0;
    for (int i=1; i<n; i++) {
        cin >> a[i];
        if (a[i]<a[i-1]){
            neVazi[j++]=i-1;
            //cout << a[i-1] << " " << a[i] <<  " " <<neVazi[j-1]<< endl;
        }
    }
    //for (int i=0; i<j; i++) cout << neVazi[i] << endl;
    cin >> q;
    for (int i=0; i<q; i++){
        cin >> l >> r;
        l--; r--;
        int levi=0, desni=j-1;
        int mid, idxl=j, idxd=j;
        while (levi<=desni){
            mid = levi + (desni-levi)/2;
            if (neVazi[mid]>=l){
                idxl = mid;
                desni = mid -1;
            }
            else levi = mid+1;
        }
        levi = 0; desni = j-1;
        while (levi<=desni){
            mid = levi + (desni-levi)/2;
            if (neVazi[mid]<r){
                idxd = mid;
                levi = mid + 1;
            }
            else desni = mid-1;
        }
        //cout << idxl << " " << idxd << endl ;
        if (idxd - idxl <= 0 || idxd==j) cout << "DA" << endl;
        else cout << "NE" << endl;


    }
    return 0;
}