#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;
    for(int i=0;i<n;i++){
        cin>>a;
        v.push_back(a);
    }
    cin>>m;
    for(int i=0;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;
    }
    p2.push_back(p1[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=0;i<m;i++){
        if((p2[q[i].second-1]-p2[q[i].first-2])>1)
            cout<<"NE\n";
        else
            cout<<"DA\n";
    }
    return 0;
}