#include<iostream>
using namespace std;
 int main(){
    int n, q;
    cin >> n;
    int niz[n];
    for (int i=0;i<n;i++){
        cin >> niz[i];
    }
    cin >> q;
    int l,r;
    int x;
    for (int i=0;i<q;i++){
        x=0;
        cin >> l >> r;
        for (int j=l;j<r;j++){
             if (niz[j]<niz[j-1]) {x=x+1;}
             if (x>1) {cout << "NE" << "\n"; break;}
        }
        if (x<=1) {cout << "DA" << "\n";}
    }
 }