#include <bits/stdc++.h>

using namespace std;

int main()
{
    int br=0;
    int n; cin >> n; int a[100005];
    for(int i = 1; i<=n; i++) cin >> a[i];
    int q; cin >> q;
    int l[100005]; int r[100005];
    for(int i = 1; i<=q; i++) cin >> l[i] >> r[i];
    for(int i = 1; i<=q; i++){ 
 
     if(l[i]<=r[i] and a[l[i]] < a[l[i+1]] ) br++;
        
    if(br==1) cout << "NE" << '\n';
    else cout << "DA" << '\n';
    }

        
        
    

    return 0;
}