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

int n;
int a[200005];
int q;
int l, r;
int asdf;
int jklc;

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