#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(0);cin.tie(0);
    //////////////////////
    int N,Q;
    cin >> N;
    int A[N];
    for(int i = 0; i < N; i++) 
        cin >> A[i];
    cin >> Q;
    pair<int,int> niz[Q];
    int a,b;
    for(int i = 0; i < Q; i++){ 
        cin >> a >> b;
        niz[i] = {a,b};
    }
    //////////////////
    //int pom[N] = {0};
    for(int i = 0; i < Q; i++){ 
        int jedinice = 0;
        for(int j = niz[i].second-1; j > niz[i].first-1; j--) {
            if(A[j-1] > A[j]) {
                jedinice++;
                if(jedinice > 1 ) {cout << "NE\n"; goto label;}
            }
        }
        cout << "DA\n";
        label:
        continue;
    }
    
    
    return 0;
}