using System;
using System.Collections.Generic;

namespace ConsoleApp3
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] A = new int[N];
            string[] inp = Console.ReadLine().Split();

            List<Tuple<int,bool,bool>> remecenje = new List<Tuple<int, bool, bool>>(); //el1 - index koji remeti; el2 - uodnosu na prosli; el3 u odnosu na pretprosli - kda bi se prosli izbrisao
            List<Tuple<int, bool>> remetiVelicinom = new List<Tuple<int, bool>>(); //index, samo Kao pocetak

            A[0] = int.Parse(inp[0]);
            A[1] = int.Parse(inp[1]);
            if (A[1] < A[0])
                remecenje.Add(new Tuple<int, bool, bool>(1,true,false));

            for (int i = 2; i < N; i++)
            {
                A[i] = int.Parse(inp[i]);
                if(A[i] < A[i - 1] ||  A[i] < A[i - 2])
                    remecenje.Add(new Tuple<int, bool, bool>(i, A[i] < A[i - 1], A[i] < A[i - 2]));

                if (A[i-2] < A[i-1] && A[i-1] > A[i] && A[i] >= A[i-2])
                    remetiVelicinom.Add(new Tuple<int, bool>(i-1, false));
                else if (A[i - 1] > A[i])
                    remetiVelicinom.Add(new Tuple<int, bool>(i - 1, true));
            }

            int Q = int.Parse(Console.ReadLine());
            bool[] res = new bool[Q];

            for (int i = 0; i < Q; i++) {
                inp = Console.ReadLine().Split();
                int l = int.Parse(inp[0])-1;
                int r = int.Parse(inp[1])-1;

                int count = 0;
                bool prosliremeti = false;
                foreach (Tuple<int, bool, bool> tup in remecenje) {
                    if (tup.Item1 > r)
                    {
                        res[i] = true;
                        break;
                    }

                    if (prosliremeti && tup.Item1 > l && tup.Item1 <= r && tup.Item3)
                        count++;
                    else if (tup.Item1 > l && tup.Item1 <= r && tup.Item2)
                    {
                        count++;
                        prosliremeti = true;
                    }
                    else
                        prosliremeti = false;


                    if (count > 1)
                    {
                        res[i] = false;
                        break;
                    }
                }
                if (count <= 1)
                {
                    res[i] = true;
                }

                count = 0;
                //Druga sansa da moze - izbacivanjem veceg, a ne manjeg
                if (!res[i])
                {
                    foreach (Tuple<int, bool> tup in remetiVelicinom)
                    {
                        if (tup.Item1 > r)
                        {
                            res[i] = true;
                            break;
                        }
                        
                        if (tup.Item1 == l)//poc
                            count++;

                        else if (tup.Item1 > l && tup.Item1 < r && !tup.Item2)
                            count++;


                        if (count > 1)
                        {
                            res[i] = false;
                            break;
                        }
                    }

                    if (count <= 1)
                    {
                        res[i] = true;
                    }
                }
            }



            foreach (bool b in res)
                Console.WriteLine(b ? "DA" : "NE");
            Console.Read();
        }
    }
}