#include <bits/stdc++.h>
#include <vector>

using namespace std;

const int maxn = 2e5;
const int maxq = 1e5;

int n, q;
int a[maxn];

int main()
{
    ios_base::sync_with_stdio(false);

    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }

    cin >> q;
    while(q--)
    {
        int l, r;
        cin >> l >> r;

        int i = l;
        while(i < r && a[i] <= a[i + 1]) i++;
        if(i == r)
        {
            cout << "DA" << endl;
            continue;
        }
        int j = i + 1;
        if(i != l && a[j] < a[i - 1] && a[j + 1] < a[i])
        {
            cout << "NE" << endl;
            continue;
        }
        while(j < r && a[j] <= a[j + 1]) j++;
        if(j == r)
        {
            cout << "DA" << endl;
            continue;
        }
        cout << "NE" << endl;
    }
    return 0;
}