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

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n =Convert.ToInt32( Console.ReadLine());
            string[] line = Console.ReadLine().Split();
            float[] niz=new float[n];
            for (int i = 0; i < n; i++)
            {
                niz[i] = Convert.ToInt32(line[i]);
            }
            int q = Convert.ToInt32(Console.ReadLine());
          
            for (int i = 0; i < q; i++)
            {
                line = Console.ReadLine().Split();
                int l = Convert.ToInt32(line[0]);
                int r = Convert.ToInt32(line[1]);
                int b=0;
                
                for (int j = l-1; j < r-2; j++)
                {
                    if (niz[j] > niz[j + 1]){
                        b++;
                    }
                    if (b > 1) {Console.WriteLine("NE");break;}
                }
                if (b < 2) Console.WriteLine("DA");
            }
          //  Console.ReadLine();
        }
    }
}