#include <bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long n;
    cin >> n;
    vector<unsigned long long> brojevi;
    unsigned long long br=0;
    vector<unsigned long long> freq(n,0);
    unsigned long long p;
    cin >> p;
    for(unsigned long long i = 1;i<n;i++){
        unsigned long long x;
        cin >> x;
        if(p>x){
            br++;
        }
        if(i>0){
            p=x;
        }
        freq[i]+=br;
    }
    unsigned long long q;
    cin >> q;
    for(unsigned long long i = 0;i<q;i++){
        unsigned long long a,b;
        cin >> a >> b;
        if(freq[b-1]-freq[a-1]<=1){
            cout << "DA" << endl;
        }else{
            cout << "NE" << endl;
        }
    }
    return 0;
}