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

namespace ConsoleApp3
{
    internal class Program
    {
        static void Main()
        {
            long N = long.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            long[] niz_promena = new long[N];
            long prvi = long.Parse(s[0]);
            niz_promena[0] = 0;
            long i = 0, k = 0;
            bool spec_sluc = false;
            bool[] A = new bool[N];
            for (i = 1; i < N; i++)
            {
                long drugi = long.Parse(s[i]);
                spec_sluc = false;
                if (prvi > drugi)
                {
                    k++;
                    if (i != N - 1)
                    {
                        long treci = long.Parse(s[i + 1]);
                        if (prvi > treci)
                        {
                            A[i + 1] = true;
                        }
                    }
                }
                niz_promena[i] = k;
                prvi = drugi;
            }

            long Q = long.Parse(Console.ReadLine());
            for (i = 0; i < Q; i++)
            {
                s = Console.ReadLine().Split(' ');
                long l = long.Parse(s[0]);
                long r = long.Parse(s[1]);
                if (A[i] == true || niz_promena[r - 1] - niz_promena[l - 1] > 1)
                {
                    Console.WriteLine("NE");
                }
                else 
                {
                    Console.WriteLine("DA");
                }
            }
        }
    }
}