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

namespace Zadatak1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int q = int.Parse(Console.ReadLine());

            string[] s;
            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]);
                r[i] = int.Parse(s[1]);
            }

            int ok = 0;
            for (int i = 0; i < q; i++)
            {
                ok = 0;
                for (int j = l[i] - 1; j < r[i] - 1; j++)
                {
                    if (a[j] > a[j + 1]) ok++;
                    if (ok > 1) break;
                }

                if (ok < 2) Console.WriteLine("DA");
                else Console.WriteLine("NE");
            }

        }
    }
}