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

int main()
{
    int n;
    vector <int> a;
    int a1,a2;
    vector<int>g;
    int o,p;
    int q;
    cin >> n;
    int i;
    int d;
    bool ne=false;
    cin >>a1;
    for (i=2;i<=n;i++)
    {
        a2=a1;
        cin >>a1;
        a.push_back(d);
        if(a1<a2)
            g.push_back(i-1);
    }
    cin >>q;
    int j;
    int k;
    int br;
    for (i=0;i<q;i++)
    {
        br=0;
        ne = false;
        cin >>o>>p;
        j=0;
        while (g[j]<o&& j<g.size())
            j++;
        while (g[j]<p && ne==false&& j<g.size())
        {
            br++;
            j++;
        if (br>1)
            ne=true;

        }
        if (br>1)
            cout <<"NE"<<endl;
        else
            cout<<"DA"<<endl;
    }
}