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

namespace ConsoleApplication285
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] str1 = Console.ReadLine().Split();
            int[] a = new int[n];
            for(int i = 0; i<n;i++)
            {
                a[i] = 0;
            }
            int q = int.Parse(Console.ReadLine());
            int p = int.Parse(str1[0]);
            for(int i = 1; i<n;i++)
            {
                int x = int.Parse(str1[i]);
                if (x < p) a[i] = a[i - 1] + 1;
                else a[i] = a[i - 1];
                p = x;
            }
            for(int i = 0; i<q;i++)
            {
                string[] str2 = Console.ReadLine().Split();
                int l = int.Parse(str2[0]) - 1;
                int r = int.Parse(str2[1]) - 1;
                bool t = true;
                if (a[r] - a[l] <= 1)
                {
                    if (a[r] - a[l] == 1)
                    {
                        int id = 0;
                        for (int janko = l; janko < r; janko++)
                        {
                            if(a[janko]==a[janko+1] - 1)
                            {
                                id = janko;
                                break;
                            }
                        }
                        if(id !=l)
                        {
                            if (a[id + 1] < a[id - 1]) t = false;
                        }
                    }
                }
                else t = false;
                if (t) Console.WriteLine("DA");
                else Console.WriteLine("NE");
            }
        }
    }
}