#include "iostream"
#include "algorithm"
#include "cmath"
#include "vector"
using namespace std;
#define forn(i, n) for (int i = 0; i < (n); i++)
#define forns(i, s, n) for (int i = s; i < (n); i++)

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        if (a[i] > 2) exit(1);
    }
    vector<int> ng(n-1);
    for (int i = 0; i + 1 < n; ++i) {
        ng[i] = (a[i + 1] < a[i]);
    }
    vector<int> nxtng(n + 1, n);
    for (int i = n - 2; i >= 0; --i) {
        if (ng[i])
            nxtng[i] = i;
        else
            nxtng[i] = nxtng[i + 1];
    }
    int q;
    cin >> q;
    forn (qq, q) {
        int l, r;
        cin >> l >> r;
        l--;
        r--;
        int stl = l;
        l = nxtng[l];
        int cnt = 0;
        if (l + 1 >= r) {
            cout << "DA\n";
            continue;
        }
        if (l == stl or a[l - 1] <= a[l + 1])
            l++;
        else {
            if (a[l] <= a[l + 2]) {
                l = l + 2;
            } else {
                cout << "NE\n";
                continue;
            }
        }
        l = nxtng[l];
        if (l >= r) {
            cout << "DA\n";
            continue;
        }
        cout << "NE\n";
    }
}