#include <bits/stdc++.h>
#define en '\n'

using namespace std;

int main()
{
    int N;
    cin >> N;
    vector <int> A (N + 1);
    A[0] = 0;
    vector <int> B (N + 1);
    B[0] = 0;
    for (int i = 1; i <= N; i++)
    {
        cin >> A[i];
        B[i] = B[i - 1];
        if (A[i - 1] > A[i])
            B[i]++;
        if (i > 1 && i < N && A[i - 1] > A[i] && A[i - 2] > A[i] && A[i - 1] > A[i + 1])
            B[i]++;
    }
    int Q;
    cin >> Q;
    for (int i = 0; i < Q; i++)
    {
        int l, r;
        cin >> l >> r;
        int x = B[r] - B[l];
        if (x <= 1)
            cout << "DA" << en;
        else
            cout << "NE" << en;
    }
}