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

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

    return false;
}

int main()
{
    vector<pair<int,int>> NE;
    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(provera(A,lr[i].first,lr[i].second))
            cout << "DA" << endl;
        else
            cout << "NE" << endl;
    }
    return 0;
}