#include <iostream>

using namespace std;

int main()
{
    long long n;
    cin >> n;
    long long a[n];
    for(long long i = 0; i < n; i++)
        cin >> a[i];

    long long q;
    cin >> q;
    long long l[q], r[q];
    for(long long i = 0; i < q; i++)
        cin >> l[i] >> r[i];

    long long b[n];
    for(long long i = 0; i < n; i++)
    {
        if(i == 0) b[i] = 0;
        else b[i] = (a[i] < a[i-1]) ? b[i-1] + 1 : 0;
    }

    // for(long long i = 0; i < n; i++)
    //     cout << b[i];
    // cout << endl;

    int s[n+1];
    s[0] = 0;
    for(long long i = 1; i < n+1; i++) {
        s[i] = b[i-1] + s[i-1];
    }
    // for(long long i = 0; i < n+1; i++)
    //    cout << s[i];
    //cout << endl;

    long long temp;
    for(long long i = 0; i < q; i++) {
        temp = s[r[i]] - s[l[i]-1];
        // cout << endl << temp << endl;
        if(b[l[i]-1] > 0) temp -= b[l[i]-1];
        // cout << temp << endl;
        if(l[i] < n && b[l[i]] > 0) temp -= b[l[i]-1];
        // cout << temp << endl;

        if(temp > 1) cout << "NE" << endl;
        else cout << "DA" << endl;
    }
    return 0;
}