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