#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

bool sortiran(vector<ll> v, ll l, ll r) {
    int n = v.size();
    if (n <= 1) return true;
    int brzamena = 0;
    for (int i = l-1; i < r-1; i++) {
        if (v[i] > v[i+1]) {
            brzamena++;
            if (brzamena > 1) return false;
            if (i > 0 && v[i+1] < v[i-1]) {
                v[i+1] = v[i];
            }
        }
    }
    return true;
}


int main(){
    ios_base::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll>a(n);
    for (ll i = 0; i < n; i++)
        cin >> a[i];
    ll q; cin >> q;
    ll l, r;
    for (ll i = 0; i < q; i++)
    {
        cin >> l >> r;
        if (sortiran(a, l, r))cout << "DA"<<endl;
        else cout << "NE"<<endl;      
    }
    
    


    return 0;   }