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];
            for(int i = 0;i<n;i++)
            {
                a[i] = int.Parse(red[i]);
            }
            int q = int.Parse(Console.ReadLine());
            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 brojrem = 0;
                for(int j = l;j<r;j++)
                {
                    if (a[j + 1] < a[j]) brojrem++;
                }
                if (brojrem > 1) res += "NE" + Environment.NewLine;
                else res += "DA" + Environment.NewLine;
            }
            Console.WriteLine(res);
            Console.Read();
        }
    }
}