#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 2e5 + 2;
const int inf = 2e9;
int a[N], b[N], c[N];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n; cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 2; i <= n; i++) {
        b[i] += b[i - 1];
        c[i] = c[i - 1];
        if (a[i - 1] > a[i]) {
            b[i] += 1;
            c[i] = i;
        }
    }
    int q; cin >> q;
    while (q--) {
        int l, r;
        cin >> l >> r;
        int o = b[r] - b[l];
        if (o > 2) {
            cout << "NE" << en;
            continue;
        }
        if (o == 0) {
            cout << "DA" << en;
            continue;
        }
        int ko = c[r];
        if (o == 1) {
            bool ok = 0;
            if (ko == l + 1 || ko == r) ok = 1;
            else if (a[ko - 1] <= a[ko + 1]) ok = 1;
            else if (a[ko - 2] <= a[ko]) ok = 1;
            if (ok) cout << "DA" << en;
            else cout << "NE" << en;
        }
        if (o == 2) {
            if (a[ko - 2] > a[ko - 1] && a[ko - 1] > a[ko]) {
                if (a[ko - 2] <= a[ko]) cout << "DA" << en;
                else cout << "NE" << en;
            }
            else cout << "NE" << en;
        }
    }
    return 0;
}