#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int a[200000];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int res[200000];

    int q;
    cin >> q;
    int l, r;
    int pred, counter;
    for (int j = 0; j < q; j++){
        cin >> l >> r;
        counter = 0;
        pred = a[l - 1];
        for (int i = l; i < r; i++){
            if (counter == 2){
                break;
            }
            if (a[i] < pred){
                counter++;
            }
            pred = a[i];

        }
        if (counter == 2){
            cout << "NE\n";

        }
        else {
            cout << "DA\n";
        }
    }


}