#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;
    for(int i=0; i<q; ++i)
    {
        int p = nizQ[i][0]-1;
        int k = nizQ[i][1]-1;
        int duzina = k-p+1;
        bool nastavi = true;
        for(int j=0; j<problem.size(); ++j)
        {
            int temp = 0;
            if(problem[j]>p && problem[j]<k)
            {
                ++temp;
            }
            if(temp >= 2)
            {
                nastavi = false;
                cout << "NE" << endl;
                break;
            }
        }
        if(nastavi == true && duzina>1)
        {
            int nizPom[duzina];
            for(int x=p; x<=k; ++x)
            {
                nizPom[x-p] = niz[x];
            }
            int temp = nizPom[0];
            int found = 0;
            for(int y=1; y<duzina; ++y)
            {
                if(nizPom[y] < temp)
                {
                    problem.push_back(y+p);
                    ++found;
                    if(found >= 2)
                    {
                        cout << "NE" << endl;
                        break;
                    }
                }
                temp = nizPom[y];
            }
            if(found < 2)
            {
                cout << "DA" << endl;
            }
        }
        else if(nastavi == true && duzina < 2)
        {
            cout << "DA" << endl;
        }
    }
}