using System;

namespace TakmicenjePoklon
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] niz = new int[n];
            string[] pre = Console.ReadLine().Split();
            for(int i = 0; i < n; i++)
            {
                niz[i] = Convert.ToInt32(pre[i]);
            }
            int q = Convert.ToInt32(Console.ReadLine());
            int[,] parametri = new int[q, 2];
            for(int i = 0; i < q; i++)
            {
                string[] red = Console.ReadLine().Split(' ');
                parametri[i, 0] = Convert.ToInt32(red[0]);
                parametri[i, 1] = Convert.ToInt32(red[1]);
            }
            int[] prelazi = new int[n - 1];
            for(int i = 0; i < n - 1; i++)
            {
                prelazi[i] = niz[i + 1] >= niz[i] ? 0 : 1;  
            }
            for(int i = 0; i < q; i++)
            {
                int zbir = 0;
                for (int j = parametri[i, 0] - 1; j < parametri[i, 1] - 1; j++)
                {
                    zbir += prelazi[j];
                }
                if(zbir <= 1)
                {
                    Console.WriteLine("DA");
                }
                else
                {
                    Console.WriteLine("NE");
                }
            }
        }
    }
}