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

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

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];
            if(arr2[i]==0){
                cnt[i]++;
                poz.push_back(i);
            }
        }


        cin>>q;
        for(int qq = 0; qq<q; qq++)
        {
            int l, r;
            cin>>l>>r;
            if(l==r || l==r-1)
            {
                cout<<"DA\n";
                break;
            }
            int dx = 0;
            vector<int>poz;
            for(int i = l; i<r; i++)
            {
                if(arr2[i]==0){
                    dx++;
                    poz.push_back(i);
                }
            }

            if(dx==0)cout<<"DA\n";
            else if(dx>1)cout<<"NE\n";
            else
            {
                if(poz[0]==l)cout<<"DA\n";
                else
                {
                    int p = poz[0];
                    if(p==r-1)cout<<"DA\n";
                    else
                    {
                        if(arr[p-1]<=arr[p+1])cout<<"DA\n";
                        else cout<<"NE\n";
                    }
                }
            }


        }


    return 0;
}