#include <bits/stdc++.h>
using namespace std;

vector<int> ns;

bool moze(int niz[],int i)
{
    if(niz[i]<niz[i+1] and niz[i+1]<niz[i+2])
        return 1;
    if(niz[i+1]<niz[i+2] and niz[i+2]<niz[i+3])
        return 1;
    if(niz[i]<niz[i+2] and niz[i+2]<niz[i+3])
        return 1;
    if(niz[i]<niz[i+1] and niz[i+1]<niz[i+3])
        return 1;
    return 0;
}

bool sadnemseg(int l,int r)
{
    int d=ns.size();
    for(int i=0;i<d;i++)
    {
        if(ns[i]>=l and ns[i]+3<=r)
        {
            return 0;
        }
    }
    return 1;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,niz[200001],q,l,r;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>niz[i];
    }
    for(int i=0;i<n-3;i++)
    {
        if(moze(niz,i))
        {
            ns.push_back(i);
        }
    }
    cin>>q;
    for(int i=0;i<q;i++)
    {
        cin>>l>>r;
        l=l-1;
        r=r-1;
        if(l==r or l==r-1)
            cout<<"DA"<<endl;
        else if(l==r-2)
        {
            if(niz[l]>niz[l+1] and niz[l+1]>niz[l+2])
            {
                cout<<"NE"<<endl;
            }
            else
            {
                cout<<"DA"<<endl;
            }
        }
        else
        {
            if(sadnemseg(l,r))
            {
               cout<<"NE"<<endl;
            }
            else
            {
                cout<<"DA"<<endl;
            }
        }
    }

    return 0;
}