using System;
class HelloWorld
{
    static int Check(int l, int r, int[] a, int[,,] dx)
    {
        if (dx[l, r, 0] != 0)
        {
            if (dx[l, r, 0] == 1) return 1;
            else return -1;
        }
        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])
                {
                    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[200000, 200000, 1];


        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) == 1) Console.WriteLine("DA");
            else Console.WriteLine("NE");
            Q--;
        }
    }
}