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

namespace ConsoleApplication136
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            long[] a=new long[n];
            string[] s=Console.ReadLine().Split(' ');
            for(long i=0;i<n;i++)
            {
                a[i] = long.Parse(s[i]);
            }
            long q = long.Parse(Console.ReadLine());
            for(long i=0;i<q;i++)
            {
                int da = 0;
                string[] str = Console.ReadLine().Split(' ');
                long l = long.Parse(str[0]) - 1;
                long r = long.Parse(str[1]) - 1;
                for(long k=l;k+1<r;k+=2)
                {
                    //long d = a[k + 1];
                    if(a[k]>a[k+1])
                    {
                        da++;
                        if(k!=l && k+1<r && a[k+1]>a[k+2])
                        {
                            if (a[k + 2] < a[k]) da++;
                        }
                        //else if(k==l)
                        //{
                            //if (a[k + 1] > a[k + 2]) da++;
                        //}
                    }
                    if(da>1)
                    {
                        if (da > 1) Console.WriteLine("NE");
                        //da = 0;
                        break;
                    }

                }
                if (da <= 1) Console.WriteLine("DA");

                

            }
            //Console.ReadLine();
        }
    }
}