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

namespace ConsoleApplication7
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split();
            int[] a = new int[n];
            
            int[] c = new int[n];
            int o = 0;
            
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(s[i]);
                if (o > a[i])
                {
                    c[i - 1] = 1;
                    c[i] = 1;
                    o = a[i];
                }
                else
                    o = a[i];
            }
            
            int q = int.Parse(Console.ReadLine());
            int[] l = new int[q];
            int[] r = new int[q];
            for (int i = 0; i < q; i++)
            {
                string[] g = Console.ReadLine().Split();
                l[i] = int.Parse(g[0]);
                l[i]--;
                r[i] = int.Parse(g[1]);
                r[i]--;
            }
            prov(c, l, r, q);
            
                Console.ReadLine();
        }
        static void prov(int[] c, int[] l, int[] r, int q)
        {
            for (int i = 0; i < q; i++)
            {
                int d = r[i];
                int max = 0;
                for (int j = l[i]; j <= r[i]; j++)
                {
                    if (j < d)
                    {
                        if (c[j] == 1)
                        {
                            if (j == l[i])
                            {
                                if (j - 1 > 0)
                                {
                                    if (c[j - 1] == 1)
                                    {

                                    }
                                    else
                                        max++;
                                }
                            }
                                else
                                    max++;
                        }
                        if (c[d] == 1)
                        {
                                if (d == r[i])
                                {
                                    if (d + 1 < c.Length)
                                    {
                                        if (c[d + 1] == 1)
                                        {

                                        }
                                        else
                                            max++;
                                    }
                                }
                                else
                                    max++;
                        }
                        if (max >= 3)
                        {
                            Console.WriteLine("NE");
                            break;
                        }
                        d--;
                    }
                }
                if (max < 3)
                    Console.WriteLine("DA");
                
            }
        }
    }
}