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 bool SviVeci(int[] d, int k, int l, int r)
        {
            for (int i = l; i <= r; i++)
            {
                if (i != k && d[i] < 0)
                    return false;
            }
            return true;
        }
        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];
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
            }
            for (int i = 1; i < n; i++)
            {
                d[i] = a[i] - a[i - 1];
            }
            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;
                for (int j = l; j <= r; j++)
                {
                    if (SviVeci(d,j,l,r))
                    {
                        t = true;
                        break;
                    }
                }
                Console.WriteLine(t ? "DA" : "NE");
            }
        }
    }
}