#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];
    
    int pom[N] = {0};
    for(int i = N-1; i >= 0; i--) 
        if(A[i-1] > A[i]) 
            pom[i-1] = 1;
            
    cin >> Q;
    int a,b;
    for(int i = 0; i < Q; i++){ 
        cin >> a >> b;
        int jedinice = 0;
        for(int j = a-1; j < b-1; j++) {
            if(pom[j] == 1) jedinice++;  
            if(jedinice > 1) {cout << "NE\n";break;}
        }
        if(jedinice < 2)
            cout << "DA\n";
    }
    //////////////////
    
    
    return 0;
}