#include <bits\stdc++.h>

#define FAST {ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
#define in insert
#define er erase
#define pb push_back
#define fi first
#define se second
#define ll long long
#define mp make_pair
#define maxn 200005

/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
*/

ll a[maxn], pref[maxn] = {};
ll promena[maxn] = {};

using namespace std;

int main()
{
    FAST
    ll n;
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(int i = 2; i <= n; i++){
        if(a[i] < a[i - 1]){
            promena[i] = 1;
        }
        pref[i] = pref[i - 1] + promena[i];
    }
    /*for(int i = 1; i <= n; i++){
        cout << promena[i] << " " << pref[i] << endl;
    }*/
    ll q;
    cin >> q;
    for(int i = 1; i <= q; i++){
        int l, r;
        cin >> l >> r;
        if(r == l || r == (l + 1)){
            cout << "DA" << endl;
            continue;
        }
        else{
            if(pref[r] - pref[l] > 1){
                cout << "NE" << endl;
                continue;
            }
            else if(pref[r] == pref[l]){
                cout << "DA" << endl;
            }
            else{
                int levi = l, desni = r;
                int mid;
                while(levi < desni){
                    mid = levi + (desni - levi) / 2;
                    if(pref[mid] == pref[l]){
                        levi = mid + 1;
                    }
                    else{
                        desni = mid;
                    }
                }
                if(mid == desni){
                    cout << "DA" << endl;
                }
                else{
                    if(a[mid - 1] <= a[mid + 1]){
                        cout << "DA" << endl;
                    }
                    else{
                        cout << "NE" << endl;
                    }
                }
            }
        }
    }
    return 0;
}