#include <bits/stdc++.h>

using namespace std;

#define ll long long

#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))

bool prime(ll a) { if (a==1) return 0; for (int i=2;i<=round(sqrt(a));++i) if (a%i==0) return 0; return 1; }
ll min(ll a,int b) { if (a<b) return a; return b; }
ll min(int a,ll b) { if (a<b) return a; return b; }
ll max(ll a,int b) { if (a>b) return a; return b; }
ll max(int a,ll b) { if (a>b) return a; return b; }

bool sorted(ll *l,ll *r)
{
    bool res = true;
    ll *i;
    if(r-l>0)
    {
        for(i=l;i-l<=r-l;++i)
        {
            if(i-r!=0 && *i<=*(i+1))
            {
                continue;
            }
            else if (i-r!=0)
            {
                res=false;
                break;
            }
        }
    }
    return res;
}

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

    ll n,q;

    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)
        cin>>a[i];

    cin>>q;
    ll lims[q][2];
    bool results[q];
    for(int i=0;i<q;++i)
    {
        cin>>lims[i][0]>>lims[i][1];
        lims[i][0]-=1;
        lims[i][1]-=1;
    }


    // SOLUTION:

    ll negVal = -1;

    ll pass;
    bool finished;
    for(int r=0;r<q;++r)
    {
        pass=2;
        finished=0;

        ll *first=a+lims[r][0];
        ll *last=a+lims[r][1];

        if(last-first<=1)
        {
            results[r]=true;
            continue;
        }
        else
        {
            ll *ch;
            ll *chp;
            ll *i;
            i=first-1;
            while(pass && finished!=1)
            {
                for(ll *j=(i+1);j<=last;++j)
                {
                    if((i+1)==j)
                        ch=j;
                    else
                        ch=j-1;

                    if(j-(i+1)<=1)
                    {
                        if(i-first>=1)
                            chp=i-1;
                        else
                            chp=&negVal;
                    }
                    else
                        chp=j-2;

                    if(*j>=*ch && *j>=*(chp) && *ch>=*(chp))
                    {
                        if (j==last)
                        {
                            //cout<<"finished on first: "<<*first<<" and last: "<<*last<<" number: "<<*j<<endl;
                            finished=1;
                        }

                    }
                    else
                    {
                        //cout<<"not pass on first: "<<*first<<" and last: "<<*last<<" number: "<<*j<<endl;
                        pass-=1;
                        {
                            if(*j>=*chp)
                                i=ch;
                            else
                                i=j;
                        }
                        if(j==last)
                            finished=1;
                        break;
                    }
                }
            }
            if(pass>0)
                results[r]=true;
            else
                results[r]=false;
        }
    }

    for(int r=0;r<q;++r)
        cout<<((results[r])?"DA":"NE")<<endl;

    return 0;
}