#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    vector<int> rez(n);
    vector<int> x;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i-1] ) x.push_back(i);
    }

    int q;
    cin>>q;
    for(int i=0;i<q;i++)
    {
        int l,r;
        cin>>l>>r;
        l--;
        r--;
        if(x.size()!=0)
        {
            auto it = lower_bound(x.begin(),x.end(),l+1);
            auto ii = upper_bound(x.begin(),x.end(),r);
            int p,k;
            p=it - x.begin();
            k= ii-x.begin();
            if(k-p>1) cout<<"NE"<<endl;
            else
            {
                int m;
                m=*it;
                if(m>r) cout<<"DA"<<endl;
                else
                {
                    if(m==r||m==l+1) cout<<"DA"<<endl;
                    else if(a[m+1]>=a[m-1]||a[m]>=a[m-2]) cout<<"DA"<<endl;
                    else cout<<"NE"<<endl;
                }
            }
        }
        else cout<<"DA"<<endl;




    }

}
//deque push front push back pop front pop back