#include <iostream>

using namespace std;

int main(int argc, char** argv) {
	
	int n;
	
	cin >> n;
	
	int a[n];
	
	for(int i = 0; i < n; i++) cin >> a[i];
	
	int q;
	
	cin >> q;
	
	int l[q], r[q];
	
	for(int i = 0; i < q; i++)
	{
		cin >> l[i] >> r[i];
	}
	
	int m = 0;
	
	for(int i = 0; i < q; i++)
	{
		m = 0;
		
		if(r[i] - l[i] <= 1) cout << "DA" << endl;
		else 
		{
			for(int j = l[i] - 1; j < r[i] - 1; j++)
			{
				if(a[j] > a[j+1]) m++;
                if(m>1 && r[i] - l[i] > 1)
                {
                    cout << "NE" << endl;
                    break;
                }
			}
			
			if(m<=1) cout << "DA" << endl;
		}
	}
	
	return 0;
}