#include <bits/stdc++.h>
#include <iomanip>

#define ll long long
#define ld long double

/*
ll gcd(ll a, ll b) { if(b==0) return a; return gcd(b,a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }
*/

using namespace std;

void da() { cout << "DA\n"; }
void ne() { cout << "NE\n"; }

bool moze(vector<int>& a, int l, int r) {
    int cnt=0;
    for(int i=l+1;i<=r;i++) {
        if(a[i-1]>a[i]) cnt++;
        if(cnt>1) return false;
    }

    return true;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, q, l, r;
    cin>>n;

    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];

    cin>>q;
    while(q--) {
        cin>>l>>r;

        if(moze(a,l-1,r-1)) da();
        else ne();
    }

    return 0;
}