#include<bits/stdc++.h>
using namespace std;
int n,q;
const int maxn=(int)2e5+10;
int a[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];
    cin >> q;
    int l,r;
    while (q--)
    {
        cin >> l >> r;
        if (r-l<=1)
        {
            cout << "DA\n";
            continue;
        }
        int br=0;
        for (int i=l; i<r; i++)
            br+=(int)(a[i]>a[i+1]);
        if (br>=2)
        {
            cout << "NE\n";
            continue;
        }
        if (br==0)
        {
            cout << "DA\n";
            continue;
        }
        if (a[l]>a[l+1])
        {
            cout << "DA\n";
            continue;
        }
        int i=l;
        while (i<r && a[i]<=a[i+1])
        {
            i++;
        }
        if (a[i]<=a[i+2] || i+1>=r)
            cout << "DA\n";
        else cout << "NE\n";
    }
    return 0;
}