#include <bits/stdc++.h>
using namespace std;

int n;
int a[200005];
int prefix[200005];
int q;
int l, r;
int accum;
bool isok;

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
	{
		scanf("%d", &a[i]);
	}
	scanf("%d", &q);

	//PREFIX SUM
	for (int i = 2; i <= n; ++i)
	{
		prefix[i] = prefix[i-1];
		if (a[i] < a[i-1])
		{
			prefix[i]++;
		}
	}

	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &l, &r);
		if (prefix[r]-prefix[l] < 2)
		{
			isok = true;
			for (int j = l+2; j <= r-1; ++j)
			{
                if (a[j] < a[j-1] && a[j] < a[j-2] && a[j+1] < a[j-1])
				{
					isok = false;
					break;
				}
			}
			if (isok == true)
			{
				printf("DA\n");
			}
			else
			{
				printf("NE\n");
			}
		}
		else
		{
			printf("NE\n");
		}
	}
	return 0;
}