#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 c[q];
    int b[n];
    b[0] = 0;
    for (int i = 1; i < n; i++) {
        b[i] = b[i - 1];
        if (a[i] < a[i - 1]) b[i] = b[i - 1] + 1;
    }
    for (int i = 0; i < q; i++) {
        int l, r;
        c[i] = "NE";
        cin >> l >> r;
        if (b[r - 1] - b[l - 1] < 2) c[i] = "DA";
    }

    for (int i = 0; i < n; i++) cout << c[i] << endl;
}