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

namespace ConsoleApplication9
{
    

    class Program
    {
        static void resenje(int l, int r, int[] b)
        {
            int razlika = 0;
            if (l > 0) razlika = b[r - 1] - b[l - 1];
            else razlika = b[r - 1] - b[l + 1];
            if (razlika > 1) Console.WriteLine("NE");
            else Console.WriteLine("DA");
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] red = Console.ReadLine().Split(' ');

            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 = "";
            int[,] a = new int[n, 2];
            for (int i = 0; i < q;i++)
            {
                string[] dred = Console.ReadLine().Split(' ');
                a[i, 0] = int.Parse(dred[0]);
                a[i, 1] = int.Parse(dred[1]);
            }
            for (int i = 0; i < q;i++)
            {
                resenje(a[i, 0]-1, a[i, 1]-1, b);
            }
           
             

            Console.Read();
        }
    }
}