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

                              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 main()
{
    int N,levi,desni;
    cin >> N;
    int niz[N];
    int niz_gresaka[N]; //meri koliko gresaka ima u ovom nizu da bi bio sortiran
    for(int i=0;i<N;i++){
        cin >> niz[i];}
    int prethodni = 0;
    niz_gresaka[0] = 0;
    for(int i=1;i<N;i++){
        if(niz[i] < niz[i-1]){
        prethodni++;}
    niz_gresaka[i] = prethodni;
    }
    cin >> N;
    for(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;
        }
    }
    
}