#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;

        }

    }


    int z = 0;

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

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

    else cout << "DA" << endl;

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

        if(l[i] < l[i-1]) for(int j = l[i]; j < l[i-1]; j++) z+= valid[j];

        else for(int j = l[i-1]; j < l[i]; j++) z -= valid[j];

        if(r[i] > r[i-1]) for(int j = r[i-1]; j < r[i]; j++) z+= valid[j];

        else for(int j = r[i]; j < r[i-1]; j++) z -= valid[j];


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

        else cout << "DA" << endl;

    }

    return 0;

}