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();
            Int64[] niz=new Int64[n];

            for (int i = 0; i < n; i++)
            {
                niz[i] = Convert.ToInt32(line[i]);
            }
            int q = Convert.ToInt32(Console.ReadLine());
            int[] r = new int[q];
            int[] l = new int[q];
            for (int i = 0; i < q; i++)
            {
                line = Console.ReadLine().Split();
                int ln = Convert.ToInt32(line[0]);
                int rn = Convert.ToInt32(line[1]);
                int b = 0;
                if (l == r){ Console.WriteLine("DA"); continue;}
                bool a = false;
                for(int k=0;k<i;k++)
                {
                    if (r[k] < r[i] && l[k] > l[i]) { a = true; break; }
                }
                if (a) { Console.WriteLine("DA");break; }
                for (int j = ln -1; j < rn -1; j++)
                {
                    if (niz[j] > niz[j + 1]){
                        b++;
                    }
                    if (b > 1) { Console.WriteLine("NE");break; }
                }
                if (b < 2) Console.WriteLine("DA");
            }
           // Console.ReadLine();
        }
    }
}