#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    vector<int> a;

    cin >> n;

    a.push_back(0);

    for(int i = 1; i <= n; i++){
        int pomocna;
        cin >> pomocna;
        a.push_back(pomocna);
    }

    int pom = 0;
    int q;
    cin >> q;
    for(int j = 0; j < q; j++){
        int x, y;
        cin >> x >> y;

        for(int i = x; i < y; i++){
            if(a[i] > a[i+1]){
                pom = i;
                break;
            }
        }

        if(pom == 0){
            cout << "DA" << endl;
            continue;
        }
        else{

            for(int i = pom + 1; i < y; i++){
                if(a[i] > a[i+1]){
                    cout << "NE" << endl;
                    goto kraj;
                }
            }

            if(a[pom - 1] <= a[pom + 1]){
                cout << "DA" << endl;
                continue;
            }
            else{
                cout << "NE" << endl;
                continue;
            }
        }

        kraj:
        continue;
    }

    return 0;
}