#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, q;
    cin >> n;
    int  niz[n];
    for(int i=0; i<n; ++i)
    {
        cin >> niz[i];
    }
    cin >> q;
    int nizQ[q][2];
    for(int i=0; i<q; ++i)
    {
        cin >> nizQ[i][0] >> nizQ[i][1];
    }
    vector<int> problem;
    int temp = niz[0];
    for(int i=1; i<n; ++i)
    {
        if(niz[i] < temp)
        {
            problem.push_back(i);
        }
        else
        {
            temp = niz[i];
        }
    }
    for(int i=0; i<q; ++i)
    {
        int p = nizQ[i][0]-1;
        int k = nizQ[i][1]-1;
        int duzina = k-p+1;
        if(duzina > 1)
        {
            int found = 0;
            for(int j=0; j<problem.size(); ++j)
            {
                if(problem[j]>p && problem[j]<=k)
                {
                    ++found;
                }
                if(found >= 2)
                {
                    cout << "NE" << endl;
                    break;
                }
            }
            if(found<2)
            {
                cout << "DA" << endl;
            }
        }
        else
        {
            cout << "DA" << endl;
        }
    }
}