using System;

namespace ConsoleApp2
    {
        internal class Program
        {
            static void Main(string[] args)
            {
                int n = int.Parse(Console.ReadLine());
                string s = Console.ReadLine();
                string[] str = s.Split(' ');
                int[] a = new int[n];
                int[] b = new int[n];
                int n1 = n;
                int i = 0;
                int j = 0;
                while (n1 > 0)
                {
                    a[i] = Convert.ToInt32(str[i]);
                     b[i] = 0;
                    if (i > 1 && a[i - 1] > a[i])
                    {
                        b[i] = 1;
                        //j++;
                    }

                    i++;
                    n1--;

                }
                i = 0;
                /*while (i < n)
                {
                    Console.WriteLine(b[i]);
                    i++;

                }*/
                b[j] = int.MaxValue;
                i = 0;
                int l;
                int d;
                int l1;
                int d1;
                int m = int.Parse(Console.ReadLine());
                int[] res = new int[m];
            int p = 0;
                while (i < m)
                {
                p = 0;
                    
                    s = Console.ReadLine();
                    str = s.Split(' ');
                    l = Convert.ToInt32(str[0]);
                    d = Convert.ToInt32(str[1]);
                    l1 = l - 1;
                    d1 = d - 1;
                    while (l < d)
                    {
                    if (b[l] == 1) p++;
                    l++;

                    }
              //  Console.WriteLine(p);
                if (p > 1) res[j] = 0;
                else res[j] = 1;
                j++;
                i++;
               
                }
                j = 0;
                while (j < i)
                {
                    if (res[j] == 1) Console.WriteLine("DA");
                    else Console.WriteLine("NE");
                    j++;

                }

            }
        }
    }