#include <iostream>
using namespace std;

bool neo(int arr[], int start, int end) {
    for (int i = start; i < end; i++) {
        if (arr[i] > arr[i + 1]) {
            return false;
        }
    }
    return true;
}

int main() {
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; i++) {
        int l, r;
        cin >> l >> r;
        if (neo(arr, l - 1, r - 1)) {
            cout << "DA\n";
        } else {
            cout << "NE\n";
        }
    }
    return 0;
}