#include <bits/stdc++.h>

using namespace std;

std::vector<pair<int,int>> problem;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, q;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    cin>>q;
    int mIndex = 0, mBroj = a[0];
    for(int i=1;i<n;i++)
    {
        if(mBroj > a[i])
            problem.push_back(pair<int, int>(i, mIndex));
        else if(a[i] > mBroj)
        {
            mIndex = i;
            mBroj = a[i];
        }
    }
        /*if(a[i-1]>a[i])
            problem.push_back(i);*/
    while(q--)
    {
        int l, r;
        cin>>l>>r;
        l--;
        int problemi = 0;
        for(auto& i:problem)
            if(i.first>=l && i.first < r && l <= i.second)
            {
                problemi++;
                if(problemi > 1)
                {
                    cout<<"NE\n";
                    break;
                }
            }

        if(problemi < 2)
            cout<<"DA\n";
    }
    return 0;
}