#include <bits/stdc++.h>


using namespace std;

int main() {
    int n;
    cin >> n;

    vector<int> a(n);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }

    int q;
    cin >> q;
    int q1=q;
vector<bool> removed(q);
removed.assign(q, false);
    while (q>0) {
        int l, r;
        cin >> l >> r;

        for (int i = l; i <= r; i++) {
            vector<int> temp(a.begin() + l, a.begin() + r + 1);
            temp.erase(temp.begin() + i - l);
            if (is_sorted(temp.begin(), temp.end())) {
                removed[q] = true;
                break;
            }
        }
        q--;
        
    }
    for(int i=q1; i>0;i--){
        if (removed[i]) {
            cout << "DA" << endl;
        } else {
            cout << "NE" << endl;
        }
    }

    return 0;
}