#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];
    cin>>q;
    while(q--)
    {
        int l,r;
        cin>>l>>r;
        int br=0;
        for(int i=l;i<r;i++)
        {
            if(a[i]<a[i-1]) br++;
            if(br>1) break;
        }
        if(br<=1) cout<<"DA"<<endl;
        else cout<<"NE"<<endl;
    }
    return 0;
}