#include <iostream>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int a[n];
    int b[n];
    b[0] = 0;
    for(int i = 0; i < n; i++) cin >> a[i];
    int c = 1;
    for(int i = 1; i < n; i++) {
        if(a[i] < a[i - 1]){
            b[i] = b[i - 1] = c;
        }
        else c++;
    }
    int d[n];
    int e = 0;
    for(int i = 0; i < n; i++) {
		if(b[i]) if(b[i] == b[i - 1] and i != 0) e++;
		d[i] = e;
    }
    int q;
    cin >> q;
    while(q--){
        int x, y;
        cin >> x >> y;
        if(d[--y] - d[--x] > 1) cout << "NE\n";
        else cout << "DA\n";
    }
    return 0;
}