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

int main()
{
    int n;
    vector <int> a;
    int o,p;
    int q;
    cin >> n;
    int i;
    int d;
    bool ne=false;
    for (i=0;i<n;i++)
    {
        cin >>d;
        a.push_back(d);
    }
    cin >>q;
    int j;
    int k;
    int br;
    for (i=0;i<q;i++)
    {
        br=0;
        cin >>o>>p;
        j=o;
        while (j<p && ne==false)
        {
            if (a[j]<a[j-1])
                {br++;}
            j++;
        if (br>1)
            ne=true;
                
        }
        if (br>1)
            cout <<"NE"<<endl;
        else
            cout<<"DA"<<endl;
    }
}