using System;
using System.Numerics;
class program
{
    static int Main()
    {
        Int64 n = int.Parse(Console.ReadLine());
        Int64[] niz = new Int64[n];

        var linija = Console.ReadLine().Split();
        for (int i=0;i<n;i++)
        {
            niz[i] = Int64.Parse(linija[i]);
        }
        Int64 q = int.Parse(Console.ReadLine());
        Int64[] poklonjeniL = new Int64[q];
        Int64[] poklonjeniR = new Int64[q]; 

        
        for (int i=0;i<q;i++)
        {
            var linija1 = Console.ReadLine().Split();
            Int64 l = Int64.Parse(linija1[0]);
            poklonjeniL[i] = l;
            Int64 r = Int64.Parse(linija1[1]);
            poklonjeniR[i] = r;
        }


        /*Int64[] B = new Int64[n];
        Array.Copy(niz, 0, B, 0, niz.Length);
        for (int i=0;i<n;i++)
        {
            if ()
        }*/

        Int64 br = 0;
        for (Int64 j =0;j<q;j++)
        {
            for (Int64 i = poklonjeniL[j] - 1; i < poklonjeniR[j] - 2; i++)
            {
                if (niz[i] > niz[i + 1])
                {
                    br++;
                    if(br>1)
                    {
                        Console.WriteLine("NE");
                        break;
                    }
                }
            }
            if (br <= 1)
            {
                Console.WriteLine("DA");
            }
            
            br = 0;
            
        }
        return 0;

    }
}