#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
    long long int n,q;
    cin>>n;
    long long int a[n+1];
    for(long long int i=1;i<n+1;i++)
        cin>>a[i];
    cin>>q;

  long long int e[q];
  long long int v[q];
    for(long long int i=0;i<q;i++)
    {
        cin>>e[i]>>v[i];
    }

    for(long long int i=0;i<q;i++)
    {
        long long int mennyi=0,lk=e[i];
        for(long long int j=e[i];j<v[i];j++)
        {
            //cout<<j<<endl;
            if(a[j]>a[j+1]/*||a[j]>lk*/)
                {
                   /* if(a[j]<lk)
                        lk=a[j];
                        */
                    mennyi++;
                    //cout<<a[j]<<" "<<a[j+1]<<"----";
                }
               // cout<<"EHH "<<mennyi<<endl;
               if(mennyi>1)
               {
                   cout<<"NE"<<endl;
                   break;
               }

        }
        if(mennyi<=1)
            cout<<"DA"<<endl;
        /*
        else
            cout<<"NE"<<endl;
            */
    }
    return 0;
}