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

namespace ConsoleApp2
{
    internal class Program
    {
        static bool check(int p, int k, int[] niz)
        {
            int strike = 0;
            if (niz[p] > niz[p + 1])
                strike++;
            int v = k - 2;
            for (int i = p + 1; strike <= 1 && i < k - 1; i++)
            {
                if (niz[i] > niz[i + 1])
                {
                    strike++;
                    if ((niz[i - 1] > niz[i+1]) && (i < v) && (niz[i] > niz[i + 2]))
                        strike++;
                }
            }

            if (strike > 1)
                return false;
            else
                return true;
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), i, r, l;
            int[] niz = new int[n];
            var s = Console.ReadLine().Split();
            for (i = 0; i < n; i++)
            {
                niz[i] = int.Parse(s[i]);
            }

            int q = int.Parse(Console.ReadLine());

            for (i = 0; i < q; i++)
            {
                s = Console.ReadLine().Split();
                r = int.Parse(s[0]) - 1;
                l = int.Parse(s[1]) - 1;
                if (check(r, l, niz))
                    Console.WriteLine("DA");
                else
                    Console.WriteLine("NE");
            }
            Console.ReadLine();
        }
    }
}