#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);
    vector <ll> pad;
    for(i=0;i<n;i++){
        cin >> a[i];
        if(i!=0){
            if(a[i-1] > a[i]){
                pad.push_back(i);
            }
        }
    }
    cin >> q;
    vector <bool> b(n);
    for(i=0;i<q;i++){
        ll x, y;
        cin >> x >> y;
        x--;
        y--;
        int d = 0;
        bool p = true;
        for(int w : pad){
            if(w > x && w <= y){
                d++;
                if(d == 2){
                    p = false;
                    break;
                }
            }
        }
        if(p){
            cout << "DA" << endl;
        }
        else{
            cout << "NE" << endl;
        }
        //cout << endl;
    }
    return 0;
}
/*
20
1 2 4 2 3 8 2 9 10 15 13 14 18 21 25 28 30 19 22 25
3
1 6
5 11
7 17
*/