#include <bits/stdc++.h>

using namespace std;
#define int long long
#define maxn 200005
vector<int> v,p1,p2;
vector<pair<int,int> > q;
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m,a,b;
    cin>>n;
    v.push_back(0);
    for(int i=1;i<=n;i++){
        cin>>a;
        v.push_back(a);
    }
    cin>>m;
    q.push_back(make_pair(0,0));
    for(int i=1;i<=m;i++){
        cin>>a>>b;
        q.push_back(make_pair(a,b));
    }
    p1.push_back(0);
    for(int i=1;i<=n;i++){
        p1.push_back(v[i]-v[i-1]);
        if(p1[i]>0)
            p1[i]=0;
        if(p1[i]<0)
            p1[i]=-1;
    }
    p2.push_back(0);
    for(int i=1;i<=n;i++){
        if(p1[i]<0)
            p2.push_back(p2[i-1]+1);
        else
            p2.push_back(p2[i-1]);
    }
    for(int i=1;i<=m;i++){
        int c=0;
            if(p1[q[i].first]<0)
                c=1;
        if((p2[q[i].second]-p2[q[i].first-1])-c>1)
            cout<<"NE\n";
        else if((p2[q[i].second]-p2[q[i].first-1])-c==1){
            int k=lower_bound(p2.begin()+q[i].first,p2.end(),p2[q[i].first]+1)-p2.begin();
            vector<int> l1,l2;
            if(q[i].first==k-1){
                l1.push_back(v[k-1]);
                l2.push_back(v[k]);
            }
            else{
                l1.push_back(v[k-2]);
                l1.push_back(v[k-1]);
                l2.push_back(v[k-2]);
                l2.push_back(v[k]);
            }
            if(q[i].second=k+1){
                l1.push_back(v[k+1]);
                l2.push_back(v[k+1]);
            }
            else{
                l1.push_back(v[k+1]);
                l1.push_back(v[k+2]);
                l2.push_back(v[k+1]);
                l2.push_back(v[k+2]);
            }
            if(is_sorted(l1.begin(),l1.end()) || is_sorted(l2.begin(),l2.end()))
                cout<<"DA\n";
            else
                cout<<"NE\n";
        }
        else
            cout<<"DA\n";
    }
    return 0;
}