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;
            int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            int[] a = new int[n];
            int[] b = new int[n];
            int br = 0;
            a[0] = int.Parse(s[0]);
            for (int i = 1; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
                if (a[i] < a[i - 1])
                {
                    b[br] = i - 1;
                    br++;
                }
            }
            int q = int.Parse(Console.ReadLine());
            int[,] c = new int[q, 2];
            for (int i = 0; i < q; i++)
            {
                s = Console.ReadLine().Split(' ');
                c[i, 0] = int.Parse(s[0]) - 1;
                c[i, 1] = int.Parse(s[1]) - 1;
                for (int j = 0; j < br && k < 2; j++)
                {
                    if ((b[j] >= c[i, 0] && b[j] < c[i, 1]) )
                    {
                        k++;
                    }
                    if((a[b[j] + 1] < a[b[j] - 1]))
                    {
                        k++;
                    }
                }
                
                if (k < 2)
                    Console.WriteLine("DA");
                else
                    Console.WriteLine("NE");
                k = 0;
            }
        }
    }
}