#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;
    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;
        for (j=o;j<p;j++)
        {
            if (a[j]<a[j-1])
                br++;
        }
        if (br>1)
            cout <<"NE"<<endl;
        else
            cout<<"DA"<<endl;
    }
}