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

namespace ConsoleApplication22
{
    class Program
    {
        /*static bool Moze(int[] a, int[] d, int l, int r)
        {
            int[] d1 = new int[d.Length];
            Array.Copy(d, d1, 0);
            int b = 0;
            for (int i = l+1; i < r; i++)
            {
                if (d1[i] < 0)
                {
                    if (a[i + 1] >= a[i - 1])
                    {
                        d1[i + 1] = a[i + 1] - a[i - 1];
                        b++;
                    }
                    else
                        return false;
                }
            }
            return b == 1 || b == 0;
        }*/
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split();
            int[] a = new int[n];
            int[] d = new int[n];
            int[] p = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
                if (i > 0)
                {
                    d[i] = a[i] - a[i - 1];
                    p[i] = p[i - 1] + (d[i] < 0 ? 1 : 0);
                }
            }
            /*for (int i = 1; i < n; i++)
            {
                d[i] = a[i] - a[i - 1];
                p[i] = p[i - 1] + (d[i] < 0 ? 1 : 0);
            }*/
            int q = int.Parse(Console.ReadLine());
            for (int i = 0; i < q; i++)
            {
                s = Console.ReadLine().Split();
                int l = int.Parse(s[0])-1, r = int.Parse(s[1])-1;
                bool t = false;
                if (p[r] - p[l] == 0)
                    t = true;
                else if (p[r] - p[l] == 1)
                {
                    for (int j = l+1; j <= r; j++)
                    {
                        if (d[j] < 0)
                        {
                            if (a[j+1]>=a[j-1])
                            {
                                t = true;
                                break;
                            }
                            if (j == r)
                            {
                                t = true;
                                break;
                            }
                            else if (j == l+1 || (j > l+1 && a[j-2] <= a[j]))
                            {
                                t = true;
                                break;
                            }
                        }
                    }
                }
                Console.WriteLine(t ? "DA" : "NE");
            }
        }
    }
}