/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int int main()
{
    long int N,levi,desni;
    cin >> N;
    long int niz[N];
    long int niz_gresaka[N+1]; //meri koliko gresaka ima u ovom nizu da bi bio sortiran
    for(long int i=0;i<N;i++){
        cin >> niz[i];}
    long int prethodni = 0;
    niz_gresaka[0] = 0;
    if(N > 1){
    for(long int i=1;i<N;i++){
        if(niz[i] < niz[i-1]){
        prethodni++;}
    niz_gresaka[i] = prethodni;
        }
    }
    cin >> N;
    for(long int i=0;i<N;i++){
        cin >> levi >> desni;
        levi--;desni--;
        if(niz_gresaka[desni] - niz_gresaka[levi] >= 2){
            cout << "NE" << endl;
        }
        else{
            cout << "DA" << endl;
        }
    }
    
}