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

namespace prvi1
{
    internal class Program
    {
        static bool Sortiran(int[] niz, int l, int r)
        {
            if (niz.Length == 1) return true;
            for (int i = l; i < r; i++)
            {
                if (niz[i] > niz[i + 1])
                {
                    return false;
                }
            }
            return true;
        }
        static int Uljez(int[] niz, int l, int r)
        {
            for (int i = l; i < r; i++)
            {
                if (niz[i] > niz[i + 1])
                {
                    return i;
                }
            }
            return -1;
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] niz = new int[n];
            string [] s = Console.ReadLine().Split();
            for(int i = 0; i < n; i++)
            {
                niz[i] = int.Parse(s[i]);
            }
            int q = int.Parse(Console.ReadLine());
            int[] l = new int[q];
            int[] r = new int[q];
            for (int i = 0; i < q; i++)
            {
                s = Console.ReadLine().Split();
                l[i] = int.Parse(s[0])-1;
                r[i] = int.Parse(s[1])-1;
            }
            for(int i = 0; i < q; i++)
            {
                int uljez = Uljez(niz, l[i], r[i]);
                if (uljez == -1)
                {
                    Console.WriteLine("DA");
                }
                else
                {
                    if (Uljez(niz, uljez + 1, r[i]) == -1)
                    {
                        Console.WriteLine("DA");
                    }
                    else Console.WriteLine("NE");
                }
            }
        }
    }
}