#include<bits/stdc++.h>
using namespace std;
int n,q;
const int maxn=(int)2e5+10;
int a[maxn];
int b[maxn];
int c[maxn];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin >> n;
    for (int i=1; i<=n; i++)
        cin >> a[i];
    b[1]=0;
    c[1]=0;
    for (int i=2; i<=n; i++)
    {
        b[i]=b[i-1]+(int)(a[i]<a[i-1]);
        if (a[i]<a[i-1]) c[i]=i;
        else
            c[i]=c[i-1];
    }
    /*for (int i=1; i<=n; i++)
        cout << b[i] << " " << c[i] << "\n";
    cout << "\n";*/
    int q;
    cin >> q;
    int l,r;
    while (q--)
    {
        cin >> l >> r;
        if (r-l<=1)
        {
            cout << "DA\n";
            continue;
        }
        if (b[r]-b[l]>=2) cout << "NE\n";
        else if (b[r]-b[l]==1)
        {
            if (c[r]==l+1) cout << "DA\n";
            else if (a[c[r]+1]<a[c[r]-1]) cout << "NE\n";
            else cout << "DA\n";
        }
        else cout << "DA\n";
    }
    return 0;
}