#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <string>
#include <cmath>
#include <limits>

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    std::vector<int> curr(n, 1);
    std::vector<int> k(n, 0), o(n, 0);
    for (int i = 0; i < n - 1; i++) {
        if (a[i] > a[i + 1]) {
            k[i] = 1;
        }
        else {
            k[i] = 0;
        }
        if (i < n - 2) {
            if (a[i] > a[i + 1] && a[i + 1] < a[i + 2] && a[i + 2] >= a[i]) {
                o[i + 1] = 1;
            }
        }
    }
    int c = 1;
    curr[n - 1] = c;
    for (int i = n - 2; i >= 0; i--) {
        if (a[i] != a[i + 1]) {
            c = 1;
        }
        else {
            c++;
        }
        curr[i] = c;
    }

    int q;
    std::cin >> q;
    for (int j = 0; j < q; j++) {
        int l, r;
        std::cin >> l >> r;
        l--;
        r--;

        if (r - l <= 1) {
            std::cout << "DA" << std::endl;
            continue;
        }

        int res = 0;
        int cc = 0;
        for (int i = l; i < r-1; i++) {
            if (k[i]) {

                if (i == r - 1) {
                    res++;
                }
                else {
                    if (o[i + 1]) {
                        res++;
                        i++;
                    }
                    else res += cc + 1;
                }
            }
            if (a[i] == a[i + 1]) {
                cc = curr[i];
                i += curr[i]-2;
            }
            else {
                cc = 0;
            }
        }
        res += (a[r - 1] > a[r]);
        if (res <= 1) {
            std::cout << "DA" << std::endl;
        }
        else {
            std::cout << "NE" << std::endl;
        }
    }
}