#include <bits/stdc++.h>
using namespace std;
using namespace std;
typedef long long ll;
typedef vector <int> vi;
typedef pair <int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#define A first
#define B second
#define PB push_back
#define MP make_pair
#define all(v) v.begin(),v.end()
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

int main()
{
    FAST
    int n,q;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++) cin>>a[i];
    int p[n];
    p[0]=0;
    for(int i=1;i<n;i++)
    {
        p[i]=p[i-1];
        if(a[i]<a[i-1]) p[i]++;
    }
    cin>>q;
    while(q--)
    {
        int l,r;
        cin>>l>>r;
        l--;
        r--;
        if(p[r]-p[l+1]>1) cout<<"NE"<<endl;
        else cout<<"DA"<<endl;
    }
    return 0;
}