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

int main()
{
  int n,q,l,d;
  cin>>n;
  vector<int>a(n+1);
   vector<int>b(n+1);
  for(int i=1;i<=n;i++)cin>>a[i];
  cin>>q;
    vector<int>r(q,0);
   l=1;d=1;
  for(int i=2;i<=n;i++){
    if(a[i]>=a[i-1])d++;
    else{
        while(l<=d){b[l]=d;l++;}
        d++;}
  }
  while(l<=d){b[l]=d;l++;}
  b[n]=n;
        for(int i=0;i<q;i++){
          cin>>l>>d;
          if(b[l]>=d-1)r[i]=1;
          else if(b[l]==l&&b[l+1]>=d)r[i]=1;
          else if(b[b[l]+2]>=d&&a[b[l]]<=a[b[l]+2])r[i]=1;


        }
  for(int i=0;i<q;i++){if(r[i]==1)cout<<"DA"<<endl;
  else cout<<"NE"<<endl;}

    return 0;
}