#include <bits/stdc++.h>

using namespace std;

int n,INF=1e9;
vector<int> a,b;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    a.resize(n);
    b.resize(n);
    for(int i=0; i < n; i++) {cin >> a[i];b[i]=INF;}
    int i=0,j = 0;
    while(j<n-1)
    {
        while(j<n-1 && a[j]<=a[j+1])j++;
        if(j<n-1)
        {
            while(i<=j)
            b[i++]=j+1;
        }
        j++;
    }


    int q; cin >> q;
    while(q--)
    {
        int l,r; cin >> l >> r;
        l--;r--;
        if(r-l+1<=2)
        {
            cout<<"DA\n";
        }
        else{
            if(b[l+1]>r) cout << "DA\n";
            else if(b[l]>=r) cout << "DA\n";
            else{
                if(b[ b[l]+1 ] > r && b[ b[l]-1 ] <= b[b[l]+1]) cout << "DA\n";
                else cout << "NE\n";
            }
        }
    }
}
/*
7
1 7 2 7 2 2 3
*/