#include <iostream>

using namespace std;

int main()
{
    int n, q, l, r, temp = 0;
    cin >> n;

    int a[n];

    for(int i = 0;i < n;i ++)
    {
        cin >> a[i];
    }
    cin >> q;
    for(int i = 0;i < q;i ++)
    {
        temp = 0;
        cin >> l >> r;

        for(int j = l-1;j < r-1;j ++)
        {
            if(a[j] > a[j+1])temp ++;
        }

        if(temp > 1)cout << "NE" << endl;
        else
            cout << "DA" << endl;
    }
    return 0;
}