#include <bits/stdc++.h>

#define mod 1e9+7
#define pb push_back
#define mp make_pair

using ll = long long;
using namespace std;

/*
7
1 7 2 7 2 2 3
4
1 4
2 7
4 6
5 5
*/

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

    ll n,q;
    vector <ll> v,ind;
    v.pb(-1);
    cin >> n;

    for(int i=1; i<=n; i++)
    {
        ll temp;

        cin >> temp;

        v.pb(temp);

        if(v[i]<v[i-1])
        {
            ind.pb(i-1);
        }
    }

    v.pb(n+1);

    cin >> q;

    for(int i=0; i<q; i++)
    {
        ll l,r;

        cin >> l;
        cin >> r;

        if(l==r)
        {
            cout << "DA" << "\n";
        }
        else
        {
            ll k=0;
            vector <ll> v1=v;
            v1[l-1]=-1;
            v1[r+1]=n+1;

            int i=0;

            while(ind[i]<l)i++;

            for(i; ind[i]<=r; i++)
            {
                if(v1[ind[i]]>v1[ind[i]+1])
                {
                    k++;

                    if(k>1)
                    {
                        cout << "NE" << "\n";
                        break;
                    }

                    if(v1[ind[i]-1]>v1[ind[i]+1])
                    {

                        v1[ind[i]+1]=v1[ind[i]];
                    }
                    else
                    {
                        v1[ind[i]]=v1[ind[i]-1];
                    }
                }
            }

            if(k<=1) cout << "DA" << endl;
        }

    }

    return 0;
}