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

namespace A1___Pokloni
{
    internal class Program
    {
        static void Main(string[] args)
        { 
            int pomocna = 0;
            int N = Convert.ToInt32(Console.ReadLine());
            int[] kriticneTacke = new int[N];
            int[] A = new int[N];
            string[] s = Console.ReadLine().Split();
            for (int i = 0; i < N; i++)
            {
                A[i] = Convert.ToInt32(s[i]);
            }
            int Q = Convert.ToInt32(Console.ReadLine());
            int[] l = new int[Q];
            int[] r = new int[Q];
            for (int i = 0; i < Q; i++)
            {
                s = Console.ReadLine().Split();
                l[i] = Convert.ToInt32(s[0]);
                r[i] = Convert.ToInt32(s[1]);
            }
            for (int i = 1; i < A.Length; i++)
            {
                if (A[i] < A[i - 1])
                {
                    kriticneTacke[pomocna] = i-1;
                    pomocna++;
                }
            }
            Array.Resize(ref kriticneTacke, pomocna);
            for (int i = 0; i < Q; i++)
            {
                pomocna = 0;
                for(int j = 0; j < kriticneTacke.Length; j++)
                {
                    if (kriticneTacke[j] >= l[i]-1 && kriticneTacke[j] < r[i]-1) pomocna++;
                }
                if (pomocna <= 1) Console.WriteLine("DA");
                else
                    Console.WriteLine("NE");
            }
        }
    }
}