#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

int main(){
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll n, q, i, j;
    cin >> n;
    vector <ll> a(n);
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    cin >> q;
    vector <bool> b(n);
    for(i=0;i<q;i++){
        ll x, y;
        bool m = false;
        bool p = true;
        cin >> x >> y;
        for(j=x-1;j<y-1;j++){
            //cout << a[j] << " ";
            if(a[j] > a[j+1]){
                if(m){
                    cout << "NE" << endl;
                    p = false;
                    break;
                }
                m = true;
            }
        }
        if(p){
            cout << "DA" << endl;
        }
        //cout << endl;
    }
    return 0;
}