#include <iostream>
#include <vector>

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]--;
    }

    vector <int> v;
    vector <int> poz;

    int uk = 0;

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

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

            poz.push_back(i);

            uk ++;

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

            else v.push_back(2);

        }

    }

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

        int z = 0;

        int j = 0;

        while(j < uk && poz[j] < r[i] && z < 2){

            if(poz[j] >= l[i])z += v[j];

            j++;
        }

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

        else cout << "DA" << endl;

    }

    return 0;

}