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

namespace ConsoleApplication14
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split();
            int[] A = new int[n];
            for (int i = 0; i < n; i++)
            {
                A[i] = int.Parse(s[i]);
            }
            int q = int.Parse(Console.ReadLine());
            int l, r;
            for (int i = 0; i < q; i++)
            {
                s = Console.ReadLine().Split();
                l = int.Parse(s[0]); l--;
                r = int.Parse(s[1]); r--;
                int br = 0;
                while (l<r)
                {
                    if (A[l] > A[l + 1]) br++;
                    if (br == 2) break;
                    l++;
                }
                if (br >= 2) Console.WriteLine("NE");
                else Console.WriteLine("DA");
            }
        }
    }
}