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

int n, q;
int arr[MAXN], arr2[MAXN], cnt[MAXN];
vector<int>poz;
set<int> el;

int fnd(int l, int r)
{
    int f = 0, s = poz.size()-1;
    while(f<=s)
    {

        int mid = (f+s)/2;
        if(poz[mid]>=l && poz[mid]<=r && poz[mid]!=r)
            return poz[mid];
        else if(poz[mid]<l)f=mid+1;
        else s=mid-1;
    }
    return f;
}

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);


    cin>>n;
    for(int i = 1; i<=n; i++){
        cin>>arr[i];
    }

        arr2[n]=1;
        for(int i = 1; i<n; i++)
        {
            if(arr[i]<=arr[i+1])arr2[i]=1;
            else arr2[i]=0;
        }

        cnt[0]=0;
        for(int i = 1; i<=n; i++)
        {
            cnt[i]=cnt[i-1]+(arr2[i]==0);
            if(arr2[i]==0)poz.push_back(i);
        }


        cin>>q;
        for(int qq = 0; qq<q; qq++)
        {
            int l, r;
            cin>>l>>r;

            int x = cnt[r]-cnt[l-1];

            if(arr2[r]==0)x--;
            if(x==0)cout<<"DA\n";
            else if(x>1)cout<<"NE\n";
            else
            {
                int p;
                // = fnd(l, r);
                for(int i = 0; i<poz.size(); i++)
                {
                    if(poz[i]>=l && poz[i]<=r)
                    {
                        p=poz[i];
                        break;
                    }
                }
                if(p==l)
                {
                    cout<<"DA\n";
                }else
                {
                    if(arr[p-1]<=arr[p+1])cout<<"DA\n";
                    else cout<<"NE\n";
                }
            }

        }


    return 0;
}