#include <bits/stdc++.h>

using namespace std;

int main()
{
    //ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int N,Q;
    cin >> N;
    vector<int>A(N);
    vector<int>s(N);
    for(int i = 0;i<N;i++)
    {
        cin >> A[i];
    }
    s[0] = 0;
    for(int i = 1;i<N;i++)
    {
        if(A[i] < A[i-1])
            s[i] = s[i-1]+1;
        else
            s[i] = s[i-1];
    }

    /*for(int i = 0;i<N;i++)
    {
        cout << s[i] << " ";
    }
    cout << endl;*/


    cin >> Q;
    for(int i = 0;i<Q;i++)
    {
        int l,r;
        cin >> l >> r;
        l--;
        r--;
        //cout << s[r] - s[l] << endl;
        if(s[r] - s[l] > 1)
            cout << "NE" << endl;
        else
            cout << "DA" << endl;
    }

    return 0;
}