using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            uint n = uint.Parse(Console.ReadLine());
            uint[] x = Console.ReadLine().Split().Select(o => uint.Parse(o)).ToArray();

            
            uint z = uint.Parse(Console.ReadLine());
            string[] odg = new string[z];
            for (uint i = 0; i < z; i++)
            {
                odg[i]=Funk(z,x);
            }
            
            for (uint i = 0; i < odg.Length; i++)
            {
                Console.WriteLine(odg[i]);
            }
            

        }
        static string Funk(uint z,uint[] x)
        {
            uint count = 1;

                uint[] y = Console.ReadLine().Split().Select(o => uint.Parse(o)).ToArray();
                for (uint j = y[0]; j < y[1]-1; j++)
                {
                    if ((x[j - 1] <= x[j])) { }
                    else if (count == 1)
                    {
                        count = 0;
                    }
                    else
                    {
                        return "NE";
                    }
                }
            return "DA";
        }
    }
}