#include<bits/stdc++.h>
using namespace std;
void unos(int a[], int b[], int n)
{
    int i;
    cin>>a[0];
    cin>>a[1];
    if(a[1] >= a[0])b[0] = 1;
    else b[0] = 0;
    for(i = 2; i<n; i++)
    {
        cin>>a[i];
        if(a[i] >= a[i-1])
        {
            b[i-1] = 1 + b[i-2];
        }
        else b[i-1] = b[i-2];
    }
    b[n-1] = b[n-2];
}
int main()
{
    int n;
    cin>>n;
    int a[n];
    int b[n];
    unos(a, b, n);
    int q, i, l, r, raz;
    cin>>q;
    for(i = 0; i<q; i++)
    {
        cin>>l>>r;
        raz = r - l;
        if(l > 1)
        {
            if(abs(raz - (b[r-1] - b[l-2])) <= 1)cout<<"DA"<<endl;
            else cout<<"NE"<<endl;
        }
        else
        {
         if(abs(raz - b[r-1]) <= 1)cout<<"DA"<<endl;
         else cout<<"NE"<<endl;
        }
    }
}