#include<bits/stdc++.h>

using namespace std;

bool provera(vector<int>& niz, int l, int r){
    l--;r--;
    int min = niz[l], minindeks = l;
    for(int i = l+1; i <= r; i++){
        if(niz[i] < min){
            min = niz[i];
            minindeks = i;
        }
    }
    if(minindeks > l+1 && minindeks < r-1) return false;
    else return true;
}

int main(){
    int n;
    cin >> n;

    vector<int> niz(n);
    for(int i = 0; i < n; i++) cin >> niz[i];

    vector<int> brisanja1(n+1);
    brisanja1[0] = 0;

    for(int i = 1; i <= n; i++){
        if(niz[i] < niz[i-1]) brisanja1[i] = brisanja1[i-1] + 1;
        else brisanja1[i] = brisanja1[i-1];
    }

    /*vector<int> brisanja2(n+1);
    brisanja2[n] = 0;

    for(int i = n-1; i >= 0; i--){
        if(niz[i-1] > niz[i]) brisanja2[i-1] = brisanja2[i] + 1;
        else brisanja2[i-1] = brisanja2[i];
    }*/

    int m;
    cin >> m;

    int l, r;
    for(int i = 0; i < m; i++){
        cin >> l >> r;
        if(/*(*/brisanja1[r-1]-brisanja1[l-1] > 1/*)*//* || (brisanja2[l]-brisanja2[r-1] > 1)*/) cout << "NE\n";
        else{
            if(provera(niz, l, r)) cout << "DA\n";
            else cout << "NE\n";
        }
        /*cout << brisanja[r]-brisanja[l-1] << "\n";*/
    }

    return 0;
}