using System;
using System.Collections.Generic;
using System.Linq;

namespace Okruzno_IlijaDoncic
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            string[] nizString = Console.ReadLine().Split();
            int[] niz = new int[n];
            niz[0] = 0;
            for (int i = 1; i < n; i++)
            {
                if (int.Parse(nizString[i - 1]) > int.Parse(nizString[i]))
                    niz[i] = 0;
                else
                    niz[i] = 1;
            }

            int q = int.Parse(Console.ReadLine());
            for (int i = 0; i < q; i++)
            {
                string[] unos = Console.ReadLine().Split();
                int l = int.Parse(unos[0]);
                int r = int.Parse(unos[1]);

                bool daLiMoze = true;
                int br = 0;
                for (int j = l; j < r; j++)
                {
                    if (niz[j] == 0)
                    {
                        br++;
                        if (br == 2)
                            daLiMoze = false;
                    }
                }

                if (daLiMoze)
                    Console.WriteLine("DA");
                else
                    Console.WriteLine("NE");
            }
        }
    }
}