#include <bits/stdc++.h>

#define ll long long
#define ld long double
#define pb push_back
#define fi first
#define se second
#define en '\n'
#define sp ' '
#define tb '\t'
#define ri(n) int n; cin >> n
#define rl(n) ll n; cin >> n
#define rs(s) string s; cin >> s
#define rc(c) char c; cin >> c
#define rv(v) for (auto &x : v) cin >> x
#define pven(v) for (auto x : v) cout << x << en
#define pv(v) for (auto x : v) cout << x << sp; cout << en
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define yes cout << "YES" << en
#define no cout << "NO" << en
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
#define ssort(a, b) if (a < b) swap(a, b)
#define bitcnt(a) (__builtin_popcountll(a))
#define bithigh(a) (63-__builtin_clzll(a))
#define lg bithigh
#define highpow(a) (1LL << (ll)lg(a))

using namespace std;

const ll LINF = 4e18;
const int mxN = 1e6+10, INF = 2e9;
ll n, m, a[mxN];
set<int> s[2];

int Get(int l, int r){

    if (r-l+1 <= 2) return -1;
    r--;
    auto it = s[0].lower_bound(l);
    if (it == s[0].end()) return -1;
    int i = *it;
    if (i > r) return -1;
    int j = *s[1].lower_bound(-r);
    j *= -1;
    if (i^j) return -2;
    return i;
}

void Solve(){

    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 0; i < n-1; i++){
        if (a[i] > a[i+1]){
            s[0].insert(i);
            s[1].insert(-i);
        }
    }
    cin >> m;
    while (m--){
        ri(l); ri(r);
        l--; r--;
        int i = Get(l, r);
        if (i == -1){
            cout << "DA\n";
            continue;
        }
        if (i == -2){
            cout << "NE\n";
            continue;
        }
        if ((i && a[i-1] <= a[i+1]) ||
            (i < n-2 && a[i] <= a[i+2])){
            cout << "DA\n";
            continue;
        }
        cout << "NE\n";
    }
}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0); cerr.tie(0);
    cout << setprecision(12) << fixed;
    cerr << setprecision(12) << fixed;
    cerr << "Started!" << endl;

    int t = 1;
    //cin >> t;
    while (t--)
        Solve();

    return 0;
}