#include <iostream>
#include <vector>

using namespace std;


int main()
{
    int n, q;
    cin >> n;
    vector<int>a;
    for (size_t i = 0; i < n; i++)
    {
        int k;
        cin >> k;
        a.push_back(k);
    }
    cin >> q;
    for (size_t i = 0; i < q; i++)
    {
        int l, r;
        cin >> l >> r;
        if (l == r) {
            cout << "DA" << endl;
        }
        else
        {
            int max = a[l - 1];
            //cout << max <<endl;
            int br = 0;
            for (size_t j = l; j < r; j++)
            {
                //cout<<a[j]<<" ";
                if (a[j] < max)
                {
                    br++;
                }
                max = a[j];
            }
            if (br < 2)
                cout << "DA";
            else
            {
                cout << "NE";
            }
            cout << endl;
        }
    }
}