#include<bits/stdc++.h>

using namespace std;

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

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

    vector<int> brisanja(n+1);
    brisanja[0] = 0;
    for(int i = 1; i <= n; i++){
        if(niz[i] < niz[i-1]) brisanja[i] = brisanja[i-1] + 1;
        else brisanja[i] = brisanja[i-1];
    }

    int m;
    cin >> m;

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

    return 0;
}