#include<iostream>
#include <bits/stdc++.h>
using namespace std;


int f( int a[],int l, int r )
{
    int m= 0;
    int s=0;
    int b[r-l];

    for (int i = 0; i < r-l; i++ )
        b[i] = 1;
    for (int i = l+1; i < r; i++ )
        for (int j = l; j < i; j++ )
            if ( a[i] > a[j] && b[i-l] < b[j-l] + 1)
            {
            b[i-l] = b[j-l] + 1;
            if(b[i-l]>r-l-2)
            {
                s=1;
                break;
            }
            }
            if(s!=1)
            {
    for (int i = l; i < r; i++ )
        if (m < b[i-l])
            m = b[i-l];
            }
            else
                m=r-l;

    return m;
}


int mb(int a[],int l,int r)
{

    int b = f(a,l, r);

    return ((r-l)-b);
}

int main()
{
   int i,j,n,l,r,q;
   cin>>n;
   int a[200001];
   bool b[100001];
   for(i=0;i<n;i++)
   {
       cin>>a[i];
   }
    cin>>q;
   for(i=0;i<q;i++)
   {
       cin>>l;
       cin>>r;
       if(l==r)
       {
           b[i]=true;
       }
       else
      {
          j=mb(a,l-1,r-1);
       if(j<2)
        b[i]=true;
       else
        b[i]=false;
       }
   }
        for(i=0;i<q;i++)
   {
       if(b[i]==true)
        cout<<"DA"<<endl;
       else
        cout<<"NE"<<endl;
   }
    return 0;
}