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)
        {
            int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(o => int.Parse(o)).ToArray();

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

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

                int[] y = Console.ReadLine().Split().Select(o => int.Parse(o)).ToArray();
                for (int 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";
        }
    }
}