#include <iostream>

using namespace std;

int main()
{
    int n, q, p1, p2, a[200005], l, r;
    cin >> n >> p1;
    a[0] = 0;
    for (int i = 1; i < n; i++)
    {
        cin >> p2;
        a[i] = a[i - 1];
        if (p2 < p1) a[i]++;
        p1 = p2;
    }
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        cin >> l >> r;
        if (a[r - 1] - a[l - 1] > 1) cout << "NE" << endl;
        else cout << "DA" << endl;
    }
}