using System;
namespace Zad2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] niz = new int[n];
            string[] nizs = Console.ReadLine().Split();
            for (int i = 0; i < n; i++)
            {
                niz[i] = int.Parse(nizs[i]);
            }
            int q = int.Parse(Console.ReadLine());
            for (int i = 0; i < q; i++)
            {
                string[] lr = Console.ReadLine().Split();
                int l = int.Parse(lr[0]), r = int.Parse(lr[1]);
                bool mogucnost = false;
                bool ispisi = true;
                if (r - l <=1)
                {
                    Console.WriteLine("DA");
                    continue;
                }
                for (int j = l - 1; j < r-1; j++)
                {
                    if (niz[j] > niz[j + 1])
                        if (mogucnost)
                        {
                            Console.WriteLine("NE");
                            mogucnost = false;
                            ispisi = false;
                            break;
                        }
                        else mogucnost = true;


                }
                if(ispisi)Console.WriteLine("DA");
                

            }
        }
    }
}