#include <iostream>
#define N 100050
#define ll long long

using namespace std;

int main()
{
    ll pom[N];
    long long n, q, i;
    cin >> n;
    ll a[N];
    for(i = 1; i <= n; i ++){
        cin >> a[i];
    }
    cin >> q;
    ll l[q + 1];
    ll r[q + 1];
    for(i = 1; i <= q; i ++){
        cin >> l[i] >> r[i];
    }
    a[0] = 0;
    pom[0] = 0;
    for(i = 1; i <= n; i ++){
        if(a[i] < a[i - 1]){
            pom[i] = pom[i - 1] + 1;
        }
        else{
            pom[i] = pom[i - 1];
        }
    }
    for(i = 1; i <= q; i ++){
        if((pom[r[i]]-pom[l[i]]) <= 1) cout << "DA" << endl;
        else cout << "NE" << endl;
    }
    return 0;
}