#include <iostream>
#include <vector>
using namespace std;

int main()
{/*
    cin.tie(0);
    ios::sync_with_stdio(false);
    */
    int n; cin >> n;

    vector<int> arr(n + 1);
    vector<int> pref(n + 1, 0);
    for (int i = 1; i <= n; i++)
    {
        int a; cin >> a;
        arr[i] = a;
    }
    int prefer = 0;

    for (int i = 1; i <= n; i++)
    {
        if (arr[i] < arr[i - 1]) prefer++;
        pref[i] += prefer;
    }
    int q; cin >> q;
    while (q--)
    {
        int l, r; cin >> l >> r;
        if(r - l <= 2) cout << "DA" << '\n';
        else if (pref[r] - pref[l - 1] > 1) cout << "NE" << '\n';
        else cout << "DA" << '\n';
    }



    return 0;
}