#include <iostream>
#include <vector>

int main()
{
    int N; 
    std::cin >> N;

    std::vector<int> pocetni(N);
    std::vector<int> resenja(N);

    for(int i = 0; i < N; i++)
        std::cin >> pocetni[i];

    int broj = 0;

    resenja[0] = 0;

    for(int i = 1; i < N; i++)
    {
        if(pocetni[i - 1] > pocetni[i])
        {
            broj++;

            //std::cout << pocetni[i - 1] << " " << pocetni[i] << "\n";
        }

        resenja[i] = broj;
    }

    /*for(int i = 0; i < N; i++)
        std::cout << resenja[i] << " ";

    std::cout << "\n";*/

    int Q; 
    std::cin >> Q;
    int A, B;

    for(int i = 0; i < Q; i++)
    {
        std::cin >> A >> B;

        if(resenja[B - 1] - resenja[A - 1] > 1)
            std::cout << "NE";
        else
            std::cout << "DA";
    }
}