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

typedef long long ll;

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];
    
    vector<ll>prefsume(n, 0);
    for (int i = 1; i < n; i++)
    {
        if(a[i] < a[i-1]){ prefsume[i]++;}
        prefsume[i] += prefsume[i-1];
    }


    
    

    ll q; cin >> q;
    ll l, r;
    for (ll i = 0; i < q; i++)
    {
        cin >> l >> r;
        ll a = prefsume[l-1], b = prefsume[r-1];
        if(b-a <= 1) cout << "DA" <<endl;
        else cout << "NE" <<endl;
              
    }
    
  


    return 0;   }