#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

int main()
{
    fast;
    int n;
    cin >> n;
    vector<int> v; // glavni niz
    vector<int> r; // od L = 1, koliko puta opada
    v.push_back(0);
    r.push_back(0);

    int broj;
    cin >> broj;
    v.push_back(broj);
    r.push_back(0);

    for(int i = 2; i <= n; i++)
    {
        cin >> broj;
        v.push_back(broj);
        if(v[i] < v[i - 1])
        {
            r.push_back(r[i - 1] + 1);
        }
        else
        {
            r.push_back(r[i - 1]);
        }
    }

    int q;
    cin >> q;

    while(q--)
    {
        int L, R;
        cin >> L >> R;

        if(r[R] - r[L] > 1) cout << "NE\n";
        else cout << "DA\n";
    }
    return 0;
}