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();
                int l, r;
                var g=Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
                l = g[0];
                r = g[1];
                if (l==r)
                {
                    Console.WriteLine("DA");
                    continue;
                }
                if (a[l-1] > a[l] || a[r-1] < a[r])
                {
                    br++;
                }
                for (int j = l ; j < r-1; j++)
                {
                    if (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();
        }
    }
}