#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int a[200000];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int res[200000];

    int counter = 0;
    int prob;
    int pred;
    int kraj;
    int i = 0;
    while (i < n){
        counter = 0;
        pred = i;
        prob = n - 1;
        kraj = n - 1;
        for (int j = i + 1; j < n; j++){



            if (a[j] < a[pred]){
                if (counter == 1){
                    kraj = j - 1;
                    break;
                }
                counter++;
                prob = pred;
              //  cout << a[pred] << " " << prob << "\n";
            }
            pred = j;
            if (j == n - 1){
                prob = n;
            }
           // cout << "prob " << prob << "\n";
          //  cout << "pred" << pred << "\n";
           // cout << "kraj" << kraj << "\n\n";
        }
        for (int q = i; q <= prob; q++){
            res[q] = kraj;
          //  cout << q << " - " << res[q] << " ; prob: " << prob << "\n";

        }

        i = prob + 1 ;

    }

    int q;
    cin >> q;
    int l, r;
    for (int w = 0; w < q; w++){
        cin >> l >> r;
        if (res[l - 1] >= r - 1){
            cout << "DA\n";
        }
        else {
            cout << "NE\n";
        }
    }


}
/*
13
1 7 2 7 4 4 5 3 8 11 7 6 10
*/