using System;
class HelloWorld
{
    static int Check(int l, int r, int[] a, int[,,] dx, int maxr, int minl)
    {
       if (r == maxr && l < minl)
        {
            dx[l, r, 0] = -1;
        }
        if (dx[l, r, 0] != 0)
        {
            return dx[l, r, 0];
        }
        else
        {
            int i = 0, count = 0;
            for (i = l; i < r; i++)
            {
                if (a[i] > a[i + 1] && count == 0)
                {
                    count++;
                }
                else if (a[i] > a[i + 1])
                {
                  if (r > maxr && l < minl)
                    {
                        minl = l;
                        maxr = r;
                    }
                    dx[l, r, 0] = -1;
                    return -1;
                }
            }
            dx[l, r, 0] = 1;
            return 1;
        }
    }
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = new int[n];
        int i = 0;
        var s = Console.ReadLine().Split();

        for (i = 0; i < n; i++)
        {
            a[i] = int.Parse(s[i]);
        }
        int Q = int.Parse(Console.ReadLine());
        int v = 0;
        int[,,] dx = new int[1000, 1000, 1];

        int maxr = 0, minl = 0;
        while (Q > 0)
        {
            s = Console.ReadLine().Split();
            int l = int.Parse(s[0]);
            int d = int.Parse(s[1]);
            l--;
            d--;

            if (Check(l, d, a, dx, maxr, minl) == 1) Console.WriteLine("DA");
            else Console.WriteLine("NE");
            Q--;
        }
    }
}