#include <iostream>

using namespace std;

/*
7
1 7 2 7 2 2 3
4
1 4
2 7
5 5
5 6

10
2 1 2 3 4 2 2 2 2 5
3
4 7
5 7
6 8
*/

int main()
{


    long long int n;
    cin>>n;
    long long int t[n+2];
    t[0]=-1;
    t[n+1]=INT_MAX;
    for(int i=1;i<=n;i++)
        cin>>t[i];

    long long int q;
    cin>>q;
    long long int elso[q], masodik[q];
    for(int i=0;i<q;i++)
        cin>>elso[i]>>masodik[i];

    //cout<<"bemenet jo";


    int minth[n+1];
    int minte[n+1];
    minte[0]=0;
    minth[n+1]=0;
    int mine=0, maxh=INT_MAX;

    for(int i=1;i<=n;i++)
    {
        if(t[i]<mine)
        {
            minte[i]=minte[i-1]+1;
        }
        else
        {
            minte[i]=minte[i-1];
            mine=t[i];
        }
        if(t[n-i]>maxh)
            minth[n-i]=minth[n-i+1]+1;
        else
        {
            minth[n-i]=minth[n-i+1];
            maxh=t[n-1];
        }
    }

    /*for(int i=1;i<=n;i++)
        cout<<minte[i]<<" ";
    cout<<endl;
    for(int i=1;i<=n;i++)
        cout<<minth[i]<<" ";
    cout<<endl;*/

    for(int i=0;i<q;i++)
    {
        int k=elso[i];
        int v=masodik[i];
        if(minte[v]-minte[k-1]<=1 || minth[k]-minth[v+1]<=1)
            cout<<"DA"<<endl;
        else
            cout<<"NE"<<endl;
    }


    return 0;
}