#include <bits/stdc++.h>

using namespace std;

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

int n, q;
int a[maxn];

bool solve(int l, int r)
{
    int i = l;
    while(i < r && a[i] <= a[i + 1]) i++;
    if(i == r || i == r - 1) return true;
    int j = i + 1;
    if(i != l && a[j] < a[i - 1] && a[j + 1] < a[i]) return false;
    while(j < r && a[j] <= a[j + 1]) j++;
    if(j == r) return true;
    if(j == r - 1 && i != l) return true;
    return false;
}

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;
        bool ans = solve(l, r);
        ans ? cout << "DA" << endl : cout << "NE" << endl;
    }
    return 0;
}