#include<bits/stdc++.h>
#define ll long long
#define vt vector
#define nl '\n'
#define sp ' '

using namespace std;

const int mxN=2e5+10;

int A[mxN],dp[mxN];

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

    int n; cin>>n;
    for(int i = 1; i <= n; ++i){
        cin>>A[i];
        if(A[i] >= A[i-1])
            dp[i] = dp[i-1]+1;
        else
            dp[i] = 1;
    }
    int q; cin>>q;
    for(int i = 1; i<= q; ++i){
        int l,r; cin>>l>>r;
        int d = r-l+1;
        d -= (dp[r] + 1);
        if(d > 0 && A[r-dp[r]+1] >= A[r-dp[r]-1]) d-= dp[r-dp[r]-1];
        if(d <= 0){
            cout << "DA\n";
        }
        else{
            if(dp[r-1]>= r-l)
                cout<< "DA" << nl;
            else
                cout << "NE\n";
        }
    }

    return 0;
}