#include <iostream>

using namespace std;

int main()
{
    int N;
    cin >> N;
    int B[N], l, c;
    B[0] = 0;
    cin >> l;
    for (int i = 1; i < N; ++i) {
        cin >> c;
        if (c < l) {
            B[i] = 1;
        }
        else {
            B[i] = 0;
        }
        l = c;
    }
    int Q;
    cin >> Q;
    int L[Q], R[Q];
    for (int i = 0; i < Q; ++i) {
        cin >> L[i] >> R[i];
    }
    for (int q = 0; q < Q; ++q) {
        c = 0;
        for (int i = L[q]; i < R[q]; ++i) {
            if (B[i] == 1) {
                ++c;
                if (c > 1) {
                    break;
                }
            }
        }
        if (c > 1) {
            cout << "NE\n";
        }
        else {
            cout << "DA\n";
        }
    }
    return 0;
}