#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    int h[n], hh[n];
    int v = 0;
    cin >> h[0];
    v = h[0];
    hh[0] = 1;
    bool muatra[n];
    muatra[0] = true;
    for(int i = 1; i < n; i++) {
        cin >> h[i];
    }
        for(int i = 1; i < n; i++) {
        if(v <= h[i]) {
            v = h[i];
            hh[i] = hh[i - 1];
        }
        else {
            if(h[i] >= h[i - 2] && i != 1) muatra[i - 1] = true;
            if(h[i + 1] >= h[i - 1] || i == n - 1) muatra[i] = true;
            v = 0;
            hh[i] = hh[i - 1] + 1;
        }
    }
    int q;
    cin >> q;
    for(int i = 0; i < q; i++) {
        int l, r;
        cin >> l >> r;
        int u = (upper_bound(hh + l - 1, hh + r, hh[l - 1]) - hh);
        if(r - l <= 1) cout << "DA" << "\n";
        else if(hh[r - 1] - hh[l - 1] < 1) cout << "DA" << "\n";
        else if(hh[r - 1] - hh[l - 1] == 1 && (muatra[u - 1] || muatra[u])) {
            cout << "DA" << "\n";

        }
        else cout << "NE" << "\n";
     //   cout << (upper_bound(hh + l - 1, hh + r, hh[l - 1]) - hh) << "\n";
    }
   // for(int i = 0; i < n; i++) cout <<hh[i] << " ";
    return 0;
}