#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,q;
    cin >> n;
    int* a = new int[n];
    for (size_t i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> q;
    for (size_t i = 0; i < q; i++)
    {
        int l, r;
        cin >> l >> r;
        if (l == r || r-1==l) {
            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++;
                    if (br > 1)
                        break;
                }
                max = a[j];
            }
            if (br < 2)
                cout << "DA";
            else
            {
                cout << "NE";
            }
            cout << endl;
        }
    }
}