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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(Console.ReadLine());
            }
            int q = int.Parse(Console.ReadLine());
            int[] l = new int[q];
            int[] r = new int[q];
            for (int i = 0; i < q; i++)
            {
                l[i] = int.Parse(Console.ReadLine());
                r[i] = int.Parse(Console.ReadLine());
            }
            
            for (int j = 0; j < q; j++)
            {
                int br = 0;
                for (int i = l[j]; i < r[j]-1; i++)
                {
                    if (a[i] >= a[i - 1]) br++;
                    if (a[i] >= a[i + 1]) br++;
                }
                if (br == (r[j] - l[j]) / 2) Console.WriteLine("DA");
                else Console.WriteLine("NE");
            }
            Console.Read();
        }
    }
}