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

using namespace std;

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

int n, q;
int a[maxn];

bool solve(int x, int y)
{
    int maxa = -1, br = 0;
    for(int i = x; i < y; i++)
    {
        a[i] > maxa ? maxa = a[i] : maxa = maxa;
        maxa > a[i + 1] ? br++ : br = br;
        if(br > 1 && br != y - x) return false;
    }
    return true;
}

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;
        ans = solve(l, r);

        ans ? cout << "DA" << endl : cout << "NE" << endl;
    }
    return 0;
}