#include<iostream>
using namespace std;

void unos(int a[], int n)
{
    for(int i=0;i<n;i++)
        cin>>a[i];
}
void unos2(int a[], int b[], int q)
{
    for(int i=0;i<q;i++)
        cin>>a[i]>>b[i];
}
void funk(int n, int a[], int q, int l[], int r[])
{
    int d[20000];
    d[0]=d[-1]=0;
    for(int i=1;i<n;i++)
        if(a[i]>=a[i-1])
            d[i]=d[i-1];
        else d[i]=1+d[i-1];
    for(int i=0;i<q;i++)
    {
        if(l[i]==r[i]-1)
            if(d[r[i]-1]-d[l[i]-2]==1)
                if(a[r[i]]>=a[l[i]]) {cout<<"DA"<<"\n"; continue;}
                else {cout<<"NE"<<"\n"; continue;}
        if(d[r[i]-1]-d[l[i]-2]<=1) {cout<<"DA"<<"\n"; continue;}
        else {cout<<"NE"<<"\n"; continue;}
    }
}

int main()
{
    int n, a[20000], q;
    cin>>n;
    unos(a,n);
    cin>>q;
    int l[10000], r[10000];
    unos2(l,r,q);
    funk(n, a, q, l, r);
    return 0;
}