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


ll a[200001];
ll da[200001];
ll pda[200001];
ll val[200001];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int q, n;
    cin >> n;
    for (int i = 0;i < n ; i++){
        cin >> a[i];

        if(i == 0){
            da[i] = a[i];
            pda[i] = 0;
        }
        else{
            da[i] = a[i]-a[i-1];

            if(da[i] < 0){
                pda[i] = pda[i-1] + 1;
            }

            else pda[i] = pda[i-1];

            if(i > 2 || i == 2){
                if(da[i-1] < 0){
                    if(a[i-2] < a[i] || a[i-2] == a[i]){
                        val[i-1] = (val[i-2]+1);
                    }
                    else val[i-1] = val[i-2];
                }
                else val[i-1] = val[i-2];
            }
            if(i == 1){
                if(da[i]<0 && (a[0] > a[2] || a[0]==a[2])) val[1]=1;
            }

        }
    }
    cin >>  q;
    while(q--){
        int l,r,neg, validnih;
        cin >> l >> r;
        l--;
        r--;
        if(l != 0){
            neg = pda[r] - pda[l];
        }
        else{
            neg = pda[r];
        }

        if(neg == 0) cout << "DA\n";
        else if(neg == 1){
            validnih = val[r-1] - val[l];
            if(validnih == 1) cout << "DA\n";
            else if(da[l+1] < 0 || da[r] < 0) cout << "DA\n";
            else cout << "NE\n";
        }
        else cout <<"NE\n";
    }

    return 0;
}