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

namespace proba
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int N, Q, broj;
            N = int.Parse(Console.ReadLine());
            int[] A = new int[N];
            var a = Console.ReadLine().Split();
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(a[i]);
            }
            Q = int.Parse(Console.ReadLine());
            for(int i = 0; i < Q; i++)
            {
                broj = 0;
                var proba = Console.ReadLine().Split();
                int l = int.Parse(proba[0]);
                int r = int.Parse(proba[1]);
                for (int j = l; j < r; j++)
                {
                    if (A[j-1] > A[j] && broj != 2)
                    {
                        broj++;
                    }
                    else if (broj == 2)
                    {
                        break;
                    }
                }
                if (broj != 2)
                {
                    Console.WriteLine("DA");
                }
                else{
                    Console.WriteLine("NE"); 
                }
            }
        }
    }
}