#include <bits/stdc++.h>
#define MAXN 200010

using namespace std;

typedef long long ll;

ll a[MAXN];
ll p[MAXN];
ll psi[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll n;
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    for(int i = 1; i < n; i++)
    {
        p[i] = p[i - 1];
        psi[i] = psi[i - 1];
        if(a[i] > a[i + 1])
        {
            p[i]++;
            psi[i] = i;
        }
    }
    ll q, l, r;
    cin >> q;
    while(q--)
    {
        cin >> l >> r;
        if(p[r - 1] - p[l - 1] >= 2) cout << "NE\n";
        else
        {
            ll ind = psi[r - 1];
            if(a[ind - 1] > a[ind + 1]) cout << "NE\n";
            else cout << "DA\n";
        }
    }
    return 0;
}