#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],ans[mxN];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    A[0]=dp[0]=ans[0] = 0;
    int n; cin>>n;
    for(int i = 1; i <= n; ++i){
        cin>>A[i];
        dp[i] = (A[i] >= A[i-1] ? dp[i-1] + 1 : 1);
    //    ans[i] = max(dp[i-1] + 1,(A[i] >= A[i-1] ? 1 + ans[i-1] : dp[i]));
        ans[i] = dp[i] + 1;
        ans[i] = max(ans[i],dp[i-1] + 1);
        if(A[i] >= A[i-1]) ans[i] = max(ans[i], 1 + ans[i-1]);
    }

    int q; cin>>q;
    for(int i = 1; i <= q; ++i){
        int l,r; cin>>l>>r;
        if(ans[r] >= r-l+1)
            cout << "DA" << nl;
        else
            cout << "NE" << nl;
    }

    return 0;
}