#include <bits/stdc++.h>

using namespace std;
#define ll long long

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

    int n;
    cin >> n;
    vector<int> a(n + 1);
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    vector<int> range(n + 1);
    range[1] = 0;
    for(int i = 2; i <= n; i++)
    {
        if(a[i] < a[i - 1])
            range[i] = range[i - 1] + 1;
        else
            range[i] = range[i - 1];
    }
    int q;
    cin >> q;
    while(q--)
    {
        int a,b;
        cin >> a >> b;
        if(range[b] - range[a] > 1)
            cout << "NE" << endl;
        else
            cout << "DA" << endl;
    }

    return 0;
}