#include <iostream>

using namespace std;

int main()
{
    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];

        l[i]--;
        r[i]--;
    }

    int valid[n] = {0};

    for(int i = 0; i < n-1; i++){

        if(a[i] > a[i+1]){

            if((a[i+1] >= a[i-1] || i == 0) || (a[i+2] >= a[i] || i+1 == n)) valid[i] = 1;

            else valid[i] = 2;

        }

    }

    for(int i = 0; i < q; i++){

        int z = 0;

        for(int j = l[i]; j < r[i]; j++) z += valid[j];

        if(z >= 2) cout << "NE" << endl;

        else cout << "DA" << endl;

    }

    return 0;

}