#include <bits/stdc++.h>
#define FAST {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ll long long
#define ull unsigned long long
#define pqueue priority_queue
#define pb push_back
#define fi first
#define se second
#define ld long double
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) (a).begin(), (a).end()
#define mp make_pair
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>
*/
// order_of_key -> # less than k
// find_by_order -> k-th element
// pq max element

const int NMAX=200010;

bool proveri(vector<int>ps, int l, int r, vector<int>k){
                l += k[l];
                if ( l < r && ps[r]-(l?ps[l-1]:0)<(2*(r-l)+1) ) {
                    return false;
                }
                return true;
}

void napravi(vector<int>&ps,vector<int>v, vector<int>&k, int n) {
        ps[0]=v[0];
        for (int i = 1 ; i < n ; i++ ) {
            ps[i]= ps[i-1]+v[i];
        }

        int k1 = 0;
        for (int i = n-1 ; i >= 0 ; i -- ) {
            if ( v[i] == 1 ) {
                k1++;
            }
            else {
                k1 = 0;
            }

            k[i] = k1;
        }
}


int main () {
    FAST
    int n;
    cin >> n;
    vector<int>v(n);

    bool nd = false;
    for (int i = 0 ; i < n ; i++ ) {
        cin >> v[i];
        if ( v[i] > 2 ) {
            nd=true;
        }
    }

    if ( !nd ) {
        vector<int>ps1(NMAX,0),ps2(NMAX,0),k1(NMAX,0),k2(NMAX,0);
        napravi(ps1,v,k1,n);
        for(int i = 0 ; i < n ; i++ ) {
            swap(v[i], v[n-1-i]);
        }

        for (int i = 0 ; i < n ; i++ ) {
            if ( v[i] == 1 ) {
                v[i] = 2;
            }
            else v[i] = 1;
        }
        napravi(ps2,v,k2,n);

        int q;
        cin >> q;
        while(q--){
            int l,r;
            cin >> l >> r;
            r--;l--;
            bool ok = false;
            ok = ok | proveri(ps1,l,r,k1);
            ok = ok | proveri(ps2,(n-1-r)-l+ l,(n-1-r)-l+r,k2);
            if ( !ok ) cout << "NE"<<endl;
            else cout << "DA"<<endl;
        }

        return 0;
    }

    vector<int>p(n,0);
    for (int i = 1 ; i < n ; i++ ) {
        if ( v[i] < v[i-1] ) p[i] = 1;
        p[i] += p[i-1];
        //cout << p[i];
    }

    int q;
    cin >> q;
    while(q--){
        int l,r;
        cin >> l >> r;
        r--;l--;
        if ( p[r]-p[l] > 1 ) {
            cout << "NE" <<endl;
        }
        else cout << "DA"<<endl;
    }

}