using System;

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

            int q = int.Parse(Console.ReadLine());
            string[] output = new string[q];
            for (int i = 0; i < q; i++)
            {
                string[] red = Console.ReadLine().Split(' ');
                int j = int.Parse(red[0]);
                int k = int.Parse(red[1]);
                bool flag = true;
                int l = 0;
                for(int s = 0;s<pom;s++)
                {
                    if(j <= uljezi[s] && k > uljezi[s])
                    {
                        if(l == 1)
                        {
                            output[i] = "NE";
                            flag = false;
                            break;
                        }
                        l++;
                    }
                }
                if (flag)
                {
                    output[i] = "DA";
                }
            }
            foreach (string s in output)
            {
                Console.WriteLine(s);
            }
        }
        static void Main(string[] args)
        {
            poklon();
        }
    }
}