using System;
class program
{
    static void Main(string[] args)
    {
        int q = int.Parse(Console.ReadLine());
        string[] s = Console.ReadLine().Split();
        int[] niz = new int[q];
        for (int i = 0; i < niz.Length; i++) niz[i] = int.Parse(s[i]);
        long n = long.Parse(Console.ReadLine());
        for (int i = 0; i < n; i++)
        {
            string[] s1 = Console.ReadLine().Split();
            int brojac = 0;
            int j = int.Parse(s1[0]) - 1;
            int l = j + 1;
            {
                while (l > 0 && l < int.Parse(s1[1]) - 1)
                {
                    if (niz[l] < niz[l - 1])
                    {
                        niz[l] = niz[l - 1];
                        brojac++;
                    }
                    else if (niz[l] > niz[l + 1])
                    {
                        niz[l + 1] = niz[l];
                        brojac++;
                    }
                    l++;
                }
            }
            if (brojac > 1)
            {
                Console.WriteLine("NE");
            }
            else Console.WriteLine("DA");
        }
    }
}