using System;

namespace MyApp // Note: actual namespace depends on the project name.
{
    internal class Program
    {
        //6 5 1 1 1 1 6 8 15 15 19 2 1 6 16 17 8 8 9 20
        public static long Neopadajuci(long[] memo, long[] niz, long m, long br)
        {
            if (memo[m] != -1) return memo[m];

            if (niz[m + 1] >= niz[m]) return memo[m];
            else return memo[m] = 1;
        }
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long[] niz = new long[N];
            long[] memo = new long[N];
            string[] c = Console.ReadLine().Split();

            long Q = long.Parse(Console.ReadLine());

            for (long i = 0; i < memo.Length; i++)
            {
                niz[i] = long.Parse(c[i]);
                memo[i] = -1;
            }

            string[] resenja = new string[Q];
            for (long i = 0; i < Q; i++)
            {
                string[] s = Console.ReadLine().Split();
                long m = long.Parse(s[0]) - 1;
                long n = long.Parse(s[1]) - 1;

               // if (m == n || (m - n) == 2) resenja[i] = "DA";  //za 1 i 2
              //  else
               // {
                    long br = 0;
                    while (br <= 1 && m < n )  
                    {
                    memo[m] = Neopadajuci(memo, niz, m, br);
                    if (memo[m] != -1) br++;
                        m++;
                    }

                    if (br <= 1) resenja[i] = "DA";
                    else resenja[i] = "NE";

               // }
            }


            


            foreach(string s in resenja) Console.WriteLine(s);
        }
    }
}