#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    long long n;
    cin >> n;
    long long a[n];
    for(long long i = 1; i <= n; i++) cin >> a[i];
    long long q;
    cin >> q;
    long long b[100000], c[100000];
    for(long long i = 1; i <= q; i++)
    {
        long long br = 0, qr = 0;
        cin >> b[i] >> c[i];
        for(long long j = b[i]; j < c[i]; j++)
        {
            if(a[j] > a[j + 1])
            {
                if(j + 1 < c[i] && a[j + 1] < a[j - 1]) qr++;
                else br++;
            }
            if(qr > 0 || br > 1) break;
        }
        if(qr > 0) cout << "NE" << endl;
        else if(br == 0 || br == 1)
        {
            cout << "DA" << endl;
        }
        else
        {
            cout << "NE" << endl;
        }
    }
    return 0;
}