#include<iostream>

using namespace std;

void provera(int A[], int l, int r)
{
    int br = 0;
    while (l < r && br<2)
    {
        if (A[l] > A[l + 1]) br++;
        l++;
    }
    if (br == 2) cout<<"NE\n";
    else cout<<"DA\n";
}


int main()
{
    int n,q, l,r;
    cin>>n;
    int A[n];
    for(int i=0;i<n;i++)
        cin>>A[i];
    cin>>q;
    for(int i=0;i<q;i++)
    {
        cin>>l>>r;
         provera(A,--l,--r);
    }

}