#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n, q;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    cin >> q;
    vector<int> br(n);
    br[0] = 0;
    for (int i = 1; i < n; i++) {
        br[i] = br[i - 1];
        if (a[i] > a[i - 1]) { br[i]++; }
    }
    for (int i = 0; i < q; i++) {
        int l, d;
        cin >> l >> d;
        if (br[d - 1] > br[l - 1] + 1) { cout << "NE"; }
        else { cout << "DA"; }
    }
}