using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int k = 0;
            long n = long.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            long[] a = new long[n];
            long[] b = new long[n];
            long br = 0;
            a[0] = long.Parse(s[0]);
            for (long i = 1; i < n; i++)
            {
                a[i] = long.Parse(s[i]);
                if (a[i] < a[i - 1])
                {
                    b[br] = i - 1;
                    br++;
                }
            }
            long q = long.Parse(Console.ReadLine());
            long[,] c = new long[q, 2];
            for (int i = 0; i < q; i++)
            {
                s = Console.ReadLine().Split(' ');
                c[i, 0] = long.Parse(s[0]) - 1;
                c[i, 1] = long.Parse(s[1]) - 1;
                for (long j = 0; j < br && k < 2; j++)
                {
                    if (b[j] >= c[i, 0] && b[j] < c[i, 1])
                    {
                        k++;
                    }

                }
                if (k < 2)
                    Console.WriteLine("DA");
                else
                    Console.WriteLine("NE");
                k = 0;
            }
        }
    }
}