int n = int.Parse(Console.ReadLine());
int[] a = new int[n];
string[] st = Console.ReadLine().Split();
for (int i = 0; i < n; i++) a[i] = int.Parse(st[i]);
int q = int.Parse(Console.ReadLine());
int[,] b = new int[q, 2];
for (int i = 0; i < q; i++)
{
    st = Console.ReadLine().Split();
    b[i, 0] = int.Parse(st[0]);
    b[i, 1] = int.Parse(st[1]);
    int x = b[i, 0] - 1;
    int y = b[i, 1] - 1;
    int br = 0;
    for (int j = x; j < y; j++)
    {
        if (a[j + 1] < a[j]) br++;
    }
    if (br > 1) Console.WriteLine("NE");
    else Console.WriteLine("DA");
}