#include <iostream>

using namespace std;

int main() {
    unsigned int n;
    unsigned int q;
    cin >> n;
    unsigned int a[n];
    for (unsigned int i = 0; i < n; i++) {
        cin >> a[i];
    }
    cin >> q;
    unsigned int l[q];
    unsigned int r[q];
    for (unsigned int i = 0; i < q; i++) {
        cin >> l[i] >> r[i];
    }
    for (unsigned int i = 0; i < q; i++) {
        unsigned int subarray[r[i] - l[i] + 1];
        for (unsigned int j = 0; j < r[i] - l[i] + 1; j++) {
            subarray[j] = a[l[i] + j - 1];
        }
        unsigned int nums = 0;
        for (unsigned int j = 1; j < r[i] - l[i] + 1; j++) {
            if (subarray[j] < subarray[j - 1]) {
                nums++;
                if (nums > 1) {
                    cout << "NE" << endl;
                    break;
                }
            }
        }
        if (nums <= 1) {
            cout << "DA" << endl;
        }
    }
    return 0;
}