#include <bits/stdc++.h>

using namespace std;

int main()
{
    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];
    int br=0;
    for(int i = 1; i<=q; i++){
        while(l[i] <= r[i]){
           if(a[l[i]] < a[l[i+1]] ) br+=0;
           else br++;
        }
    if(br==1) cout << "DA";
    else cout << "NE";
            

        
        
    }

    return 0;
}