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

#define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define inf INT_MAX
#define llinf LLONG_MAX
#define mt make_tuple
#define mp make_pair
#define parll pair<ll,ll>
#define parii pair<int,int>
#define nzd __gcd
#define nzs(e1,e2) (e1/nzd(e1,e2))*e2
#define neparno(v) (v&1)
#define parno(v) (!neparno(v))
#define lowbit(v) (v&-v)
#define all(V) V.begin(),V.end()
#define fill(V,v) fill(all(V),v)
#define l_b(BRL,brl) lower_bound( BRL.begin(), BRL.end(), brl )-BRL.begin()-1
#define u_b(BRU,bru) upper_bound( BRU.begin(), BRU.end(), bru )-BRU.begin()
#define mod 1000000007
#define mxn 200005

ll q,n,A[mxn],B[mxn],P[mxn],C[mxn],PC[mxn];
bool drugikurac = true;

void Metoda()
{
    for ( ll i = 1; i <= n; i++ )
    {
        if ( A[i] > 2 )
        {
            drugikurac = false;
            return;
        }
    }
    ll k1=0,k2=0,p=0;
    for ( ll i = 1; i <= n; i++ )
    {
        if ( A[i] == 2 )
        {
            if ( A[i-1] == 1 )
            {
                k2 = 0;
            }
            k2++;
            k1 = 0;
            p = 0;
        }
        if ( A[i] == 1 && k2 > 0 )
        {
            k1++;
            if ( i > 1 && C[p] == min(k1,k2) )
            {
                continue;
            }
            C[i] = min(k1,k2);
            if ( p == 0 )
            {
                p = i;
            }
        }
    }
    for ( ll i = 1; i <= n; i++ )
    {
        PC[i] = PC[i-1]+C[i];
        //cout << PC[i] << " ";
    }
    //cout << "\n";
}

ll OvajKurac( ll l, ll r )
{
    if ( PC[r]-PC[l+1] >= 2 )
    {
        return 2;
    }
    return 0;
}

int main()
{
    ios;

    cin >> n;
    for ( ll i = 1; i <= n; i++ )
    {
        cin >> A[i];
        if ( i > 1 && A[i] < A[i-1] )
        {
            B[i] = 1;
        }
    }
    for ( ll i = 1; i <= n; i++ )
    {
        P[i] = P[i-1]+B[i];
    }
    Metoda();

    cin >> q;
    ll l,r;
    while ( q-- )
    {
        cin >> l >> r;
        if ( P[r]-P[l]+OvajKurac(l,r) <= 1 )
        {
            cout << "DA\n";
            continue;
        }
        cout << "NE\n";
    }

    return 0;
}