#include <bits/stdc++.h>

using namespace std;


int n,q;
int A[200100];
pair<int,int> Q[200100];
int b=0;
pair<int,int> B[200100];


void check(int l,int r)
{
    for(int i=0;i<b;i++)
    {
        if(l >= B[i].first and r <= B[i].second)
        {
            cout<<"DA"<<endl;
            return;
        }
    }
    cout<<"NE"<<endl;
    return;
}


void makeborders(int i)
{
    int X = -1;
    int l = i,r = n;
    while(i < n)
    {
        if(A[i] > A[i+1])
        {
            if(X == -1)
            {
                X = i;
            }else{
                r = i;
                B[b].first = l;
                B[b].second = r;
                b++;
                makeborders(X+1);
                return;
            }
        }
        i++;
    }
    B[b].first = l;
    B[b].second = r;
    b++;
}




int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>A[i];
    }
    makeborders(0);
    cin>>q;
    int l,r;
    for(int i=0;i<q;i++)
    {
        cin>>Q[i].first>>Q[i].second;
    }
    for(int i=0;i<q;i++)
    {
        if(Q[i].first == Q[i].second)
        {
            cout<<"DA"<<endl;
        }
        else
        {
            check(Q[i].first-1,Q[i].second-1);
        }
    }
    return 0;
}