#include <iostream>
#include <vector>

using namespace std;

vector<int> a;
vector<int> losi;
vector<int> l, r;

int main()
{
    int n;
    cin >> n;
    a.push_back(0);
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        a.push_back(x);
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        int l1, r1;
        cin >> l1 >> r1;
        l.push_back(l1);
        r.push_back(r1);
    }
    for (int i = 1; i < n; i++)
    {
        if (a[i] > a[i + 1])
            losi.push_back(i);
    }
    for (int i = 0; i < q; i++)
    {
        int left = 0;
        while (left < losi.size())
        {
            if (losi[left] >= l[i])
                break;
            left++;
        }
        int right = left + 1;
        if (right >= losi.size())
            cout << "DA" << endl;
        else if (losi[right] >= r[i])
            cout << "DA" << endl;
        else
            cout << "NE" << endl;
    }
    return 0;
}