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

int n;
int a[200005];
int prefix[200005];
int q;
int l, r;
int accum;
int asdf;
int jklc;
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])
		{
			accum = 0;
			for (int j = i-1; j >= 1; --j)
			{
                if (a[i] < a[j])
				{
					++accum;
				}
				else
				{
					break;
				}
			}
			prefix[i]+=accum;;
		}
	}

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