#include <iostream>
#include <bits/stdc++.h>
#define ll long long
#define F1 {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ull unsigned long long
#define pb push_back
#define fi first
#define se second
#define ld lond duble
#define pii pair<int,int>
#define pll pair<long long,long long>
#define mp make_pair
using namespace std;


int main()
{
    F1;
    int n;
    cin>>n;
    vector<int>a(n);
    int sl[n];
    int sr[n];
    int h=1;
    sl[1]=1;
    for(int i=1;i<=n;i++){
     cin>>a[i];if(a[i]<a[i-1]){sr[h]=a[i-1];
     sl[h+1]=a[i];}
    }
    int q;
    cin>>q;
    vector<int>l(q);
    vector<int>r(q);
    for(int j=1;j<=q;j++)
     cin>>l[j]>>r[j];
     int br=0;
    for(int k=1;k<=q;k++){
        br=0;
        if(l[k]==r[k])cout<<"DA"<<endl;
        else if(l[k]==r[k-1])cout<<"DA"<<endl;
        else{

            for(int z=l[k]+1;z<=r[k];z++)
        {
            if(a[z]<a[z-1])br++;
            if(br==2){cout<<"NE"<<endl;break;
        }
        }
        if(br==0||br==1)cout<<"DA"<<endl;

    }}

    return 0;
}