#include <bits/stdc++.h>

#define int long long
using namespace std;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
    int n;
    cin >>n;
    vector<int>a(n);
    for (int i=0;i<n;i++) cin >>a[i];
    //pravimo template
    vector<int>t(n, 0);
    int x=1;
    bool first=1;
    vector<int>b;
    for (int i=0;i<n;i++){
        if (a[i] <= a[i+1]) t[i]=x;
        else{
            if (a[i] <= a[i+2]){
                t[i]=x;
                continue;
            }
            t[i]=x;
            if (first){
                x=0;
                first=0;
            }
            else{
                x=1;
                first=1;
            }
        }
    }
    //for (int i=0;i<n;i++) cout <<t[i]<<' ';
    //cout <<endl;
    vector<int>pf(n);
    pf[0]=t[0];
    for (int i=1;i<n;i++) pf[i]=pf[i-1]+t[i];

    int q, l, r, sum, br;
    cin >>q;
    while (q--){
        cin >>l>>r;
        l--;
        r--;
        br=r-l+1;
        if (l==0) sum=pf[r];
        else sum=pf[r]-pf[l-1];
        if (sum == 0) cout <<"DA"<<endl;
        else if (sum == br) cout <<"DA"<<endl;
        else if (sum+1==br) cout <<"DA"<<endl;
        else if (sum == 1) cout <<"DA"<<endl;
        else cout <<"NE"<<endl;
    }

    return 0;
}