#include <iostream>
using namespace std;

int main() {
    int n, q;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    cin >> q;
    int c[q];
    int r, l, k, x = 0;
    for (int i = 0; i < q; i++) {
        k = 0;
        cin >> r >> l;
        for (int j = r ; j < l; j++) {
            if (a[j] < a[j-1]) {
                k++;
            }
        }
        if (k > 1) {
            c[x] = 1;
        } else {
            c[x] = 0;
        }
        x++;
    }
    for (int i = 0; i < q; i++) {
        if (c[i] == 1) {
            cout << "NE" << endl;
        } else {
            cout << "DA" << endl;
        }
    }
    return 0;
}