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 =int.Parse( Console.ReadLine());
            string[] line = Console.ReadLine().Split();
            long[] niz=new long[n];

            for (int i = 0; i < n; i++)
            {
                niz[i] = int.Parse(line[i]);
            }
            int q = int.Parse(Console.ReadLine());
            int[] r = new int[q];
            int[] l = new int[q];
            bool[] w = new bool[q];
            for (int i = 0; i < q; i++)
            {
                line = Console.ReadLine().Split();
                int ln = int.Parse(line[0]);
                int rn = int.Parse(line[1]);
                r[i] = rn;
                l[i] = ln;
                int b = 0;
                if (l == r){ Console.WriteLine("DA");w[i] = true; continue;}
                bool a = false;
                for(int k=0;k<i;k++)
                {
                    if (r[k] > r[i] && l[k] < l[i] && w[i]) { a = true; break; }
                }
                if (a) { Console.WriteLine("DA"); w[i] = true; 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"); w[i] = true; }
                }
           // Console.ReadLine();
        }
    }
}