#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k;
    cin>>n;
    vector <int> a;
    int dp[n];
    for (int i=0;i<n;i++)
    {
        cin>>k;
        a.push_back(k);
        if (i==0)
        {
            dp[i]=0;
        }
        else
        {
            if (a[i-1]>a[i])
            {
                dp[i]=dp[i-1]+1;
            }
            else
            {
                dp[i]=dp[i-1];
            }
        }
    }
    int q;
    cin>>q;
    int l,r;
    vector <int> b;
    for (int i=0;i<q;i++)
    {
        cin>>l>>r;
        int tren=dp[r-1] - dp[l-1];
        if (tren>1)
        {
            cout<<"NE"<<endl;
        }
        else
        {
            cout<<"DA"<<endl;
        }
    }
}