#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    const int value = -1;
    int n, q;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    cin >> q;
    string b[q];
    for (int i = 0; i < q; i++) {
        b[i] = "NE";
        int l, r;
        cin >> l >> r;
        int counter = 0;
        for (int j = l; j < r; j++) if (a[j] < a[j - 1]) counter++;
        if (counter < 2) b[i] = "DA";
    }
    for (int i = 0; i < q; i++) cout << b[i] << endl;
}