#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);
    if (a[0] < a[1]) t[0]=1;
    else if (a[0] == a[1]) t[0]=0;
    else t[0]=-1;
    for (int i=1;i<n;i++){
        if (a[i] < a[i-1]) t[i]=-1;
        else if (a[i] == a[i-1]) t[i]=1;
        else t[i]=1;
    }

    //vektor prefix niza
    vector<int>pf(n);
    pf[0]=t[0];
    for (int i=1;i<n;i++){
        pf[i]=pf[i-1]+t[i];
    }

    //for (int i=0;i<n;i++) cout <<t[i]<<' ';
    //cout <<endl;
    //for (int i=0;i<n;i++) cout <<pf[i]<<' ';
    //cout <<endl;

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

    return 0;
}