#include <bits/stdc++.h>
#define xx first
#define yy second

typedef long long ll;

using namespace std;

const int maxn=2e5+10;

int a[maxn];
int dp[maxn][2];

int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    dp[n-1][0]=n-1;
    for(int i=n-2;i>=0;i--){
        if(a[i]<=a[i+1]){
            dp[i][0]=dp[i+1][0];
            dp[i][1]=dp[i+1][1];
        }else{
            dp[i][0]=i;
            if(i+2<n && a[i]<=a[i+2]) dp[i][1]=dp[i+2][0];
        }
    }
    int q;
    cin>>q;
    while(q--){
        int l,r;
        cin>>l>>r;
        l--; r--;
        bool moze=false;
        if(r-l<2){
            cout<<"DA\n";
            continue;
        }
        if(dp[l][1]>=r) moze=true;
        if(dp[l+1][0]>=r) moze=true;
        if(moze) cout<<"DA\n";
        else cout<<"NE\n";
    }
    return 0;
}