using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication32
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = new int[n];
            string[] s = Console.ReadLine().Split();
            int[] promene = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
                if (i != 0)
                {
                    if (a[i] < a[i - 1])
                    {
                        promene[i] = 1;
                    }
                    else
                    {
                        promene[i] = 0;
                    }
                }
                else
                {
                    promene[i] = 0;
                }
            }
            int q = int.Parse(Console.ReadLine());
            int[,] br12 = new int[q,2];          
            for (int i = 0; i < q; i++)
            {
                string[] s1= Console.ReadLine().Split();
                br12[i, 0] = int.Parse(s1[0]);
                br12[i, 1] = int.Parse(s1[1]);
            }
            int t=0;
            while (t < q)
            {
                int b=0;
                int y = 0;
                for (int i = br12[t,0]-1; i < br12[t,1]-1; i++)
                {
                    y = y + promene[i];
                    if (y > 1)
                    {
                        b = 1;
                        Console.WriteLine("NE");
                        break;
                    }
                }
                if (b == 0)
                {
                    Console.WriteLine("DA");
                }                
                t++;
            }
            Console.ReadLine();
        }
    }
}