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

vector<int> NE;
bool provera(const vector<int>& a,int l,int r){
    int i = l,n = r;
    int los;
    while(a[i]<=a[i+1] && i < n)
        ++i;
    if(i == n){
        return true;
    }
    NE.push_back(i);
    ++i;
    while(a[i]<=a[i+1] && i < n)
        ++i;
    if(i == n){
        return true;
    }
    NE.push_back(i);
    sort(NE.begin(),NE.end());

    return false;
}

int main()
{
    vector<int> A;
    bool odgovor;
    int n,q,broj;
    int l,r;



    cin >> n;

    for(int i = 0;i < n;i++){
        cin >> broj;
        A.push_back(broj);
    }
    cin >> q;

    vector<pair <int,int>> lr(q);
    for(int i = 0;i < q;i++){
        cin >> l >> r;
        lr[i]=make_pair(l-1,r-1);
    }

    for(int i = 0;i < q;i++){
        if(lr[i].second - lr[i].first < 3)
            cout << "DA" << endl;
        else{
            if(upper_bound(NE.begin(),NE.end(),lr[i].second) - 1 - upper_bound(NE.begin(),NE.end(),lr[i].first) > 2)
                cout << "NE" << endl;
            else
                if(provera(A,lr[i].first,lr[i].second))
                    cout << "DA" << endl;
                else
                    cout << "NE" << endl;
        }
    }
    return 0;
}