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

namespace Takmicenje
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int[] a = new int[int.Parse(Console.ReadLine())];
            string s = Console.ReadLine();
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = int.Parse(s.Split(' ')[i]);
            }
            int q = int.Parse(Console.ReadLine());
            for (int i = 0; i < q; i++)
            {
                int br = 0;
                s = Console.ReadLine();
                for (int j = int.Parse(s.Split(' ')[0]); j < int.Parse(s.Split(' ')[1]); j++)
                {
                    if (Math.Max(a[j - 1], a[j]) == a[j - 1] && a[j - 1] != a[j]) br++;
                    if (br == 2)
                    {
                        Console.WriteLine("NE");
                        break;
                    }

                }
                if (br < 2) Console.WriteLine("DA");
            }
        }
    }
}