#include <iostream>
#include <vector>
#define ll long long
using namespace std;

int main()
{
     ll a0,a1;
    ll n; cin>>n;
    vector<vector<ll> > b(n);
    cin>>a0;
    b[0].push_back(0);
    for(ll i=1;i<n;i++)
    {
        cin>>a1;
        if(a1<a0) b[0].push_back(b[0][i-1]+1);
        else b[0].push_back(b[0][i-1]);

        a0=a1;
    }
    for(ll i=1;i<n;i++)
    {
        for(ll j=0;j<i+1;j++)
            b[i].push_back(0);
        for(ll j=i+1;j<n;j++)
        {
            b[i].push_back(b[i-1][j]-(b[i-1][j-1]-b[i][j-1]));
        }
    }
    ll q; cin>>q;
    for(ll i=0;i<q;i++)
    {
        ll l,r;
        cin>>l>>r;
        if(b[l-1][r-1]>=2) cout<<"NE"<<endl;
        else cout<<"DA"<<endl;
    }
    return 0;
}