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

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] red = Console.ReadLine().Split();
            int[] a = new int[n];
            int q = int.Parse(Console.ReadLine());
            int[] b = new int[n];
            int suma = 0;
            for(int i = 0;i<n-1;i++)
            {
                int broj1 = int.Parse(red[i]);
                int broj2 = int.Parse(red[i + 1]);
                if(broj1>broj2)
                {
                    suma += 1;
                }
                b[i] = suma;
            }
            string res = "";
            for (int i = 0; i < q; i++)
            {
                string[] dred = Console.ReadLine().Split();
                int l = int.Parse(dred[0]) - 1;
                int r = int.Parse(dred[1]) - 1;
                int razlika = 0;
                if (l > 0)
                {
                    razlika = b[r - 1] - b[l - 1];
                }
                else razlika = b[r - 1] - b[l + 1];
                if (razlika > 1) res += "NE" + Environment.NewLine;
                else res += "DA" + Environment.NewLine;
            }
            
            Console.WriteLine(res);
            Console.Read();
        }
    }
}