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

int main()
{
    short n; cin>>n;
    int a0,a1;
    vector<vector<short> > b(n);
    cin>>a0;
    b[0].push_back(0);
    for(short i=1;i<n;i++)
    {
        cin>>a1;
        if(a1<a0) b[0].push_back(b[0][i-1]+1);
        else b[0].push_back(b[0][i-1]);
        a0=a1;
    }
    for(short i=1;i<n;i++)
    {
        b[i].push_back(0);
        for(short j=1;j<n-i;j++)
        {
            b[i].push_back(b[i-1][j+1]-(b[i-1][j]-b[i][j-1]));
        }
    }
    short q; cin>>q;
    for(short i=0;i<q;i++)
    {
        short l,r;
        cin>>l>>r;
        if(b[l-1][r-l]>=2) cout<<"NE"<<endl;
        else cout<<"DA"<<endl;
    }
    return 0;
}