#include <bits/stdc++.h>

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;

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

    vector<int> x(n+1);

    for(int i = 1; i < n; ++i){
        x[i+1] = x[i];
        if(a[i] >= a[i-1]) continue;
        if(i == 1) { ++x[i+1]; continue; }
        if(a[i-2] <= a[i]) { ++x[i+1]; continue; }
        if(a[i-1] >= a[i-2]) { ++x[i+1]; continue; }
        x[i+1] += 2;
    }

    int q;

    cin >> q;

    while(q--){
        int l, r;

        cin >> l >> r;

        if(x[r] - x[l] < 2) cout << "DA\n";
        else cout << "NE\n";
    }
    return 0;
}