#include <bits/stdc++.h>

using namespace std;

int main () {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    long long n;

    cin >> n;

    long long a[n];
    long long q;

    for (long long i = 0 ; i < n ; i++) {

        cin >> a[i];

    }

    cin>>q;

    long long x, y;

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

        cin >> x >> y;

        x--;
        y--;

        long long counter = 1;

        for(long long j = x ; j < y+1 ; j++) {

            if (j == y) { continue; }

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

                counter--;
                if (counter < 0) { cout << "NE\n"; break; }

            }

        }

        if (counter > -1) { cout << "DA\n"; }

    }

    return 0;

}