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

namespace Test
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = new int[n];
            StringBuilder sb= new StringBuilder();
            a = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            int q = int.Parse(Console.ReadLine());
            for (int i = 1; i <= q; i++)
            {
                int br = 0;
                sb.Clear();
                var g=Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                int l = g[0];
                int r = g[1];
                l--;
                r--;
                if (l==r)
                {
                    Console.WriteLine("DA");
                    continue;
                }
                if (l + 1==r)
                {
                    Console.WriteLine("DA");
                    continue;
                }
                if (a[l] > a[l+1] || a[r] < a[r-1])
                {
                    br++;
                }
                for (int j = l+1 ; j < r; j++)
                {
                    if ((a[j] >= a[j - 1] && a[j] > a[j + 1]) || (a[j] > a[j - 1] && a[j] >= a[j + 1]))
                    {
                        br++;
                    }
                }
                if (br > 1)
                {
                    sb.Append("NE");
                }
                else
                {
                    sb.Append("DA");
                }
                Console.WriteLine(sb.ToString());
            }
            Console.ReadLine();
        }
    }
}