#include <bits/stdc++.h>

using namespace std;
void moguc(const vector<int> &g, vector<pair<int, int>> &poklon, int n, int q){
    for(int i = 1; i <= q; i++){
            int tmp = 0;
            int br = 0;
        for(int j = poklon[i].first ; j < poklon[i].second; j++){
            if(tmp > g[j])
                br++;
            else{
                if(br == 2){
                    cout<<"NE"<<endl;
                    break;}
            }
            tmp = g[j];
        }
        if(br < 2)
            cout<<"DA"<<endl;
    }
    
}
int main()
{
    ios_base::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> g(n);
    for(int i = 1; i <= n; i++){
        cin >> g[i];
    }
    int q; cin >> q;
    int l, r;
    vector<pair<int, int>> poklon(q);
    
    for(int i = 1; i <= q; i++){
        cin >> l >> r;
        
        poklon[i] = make_pair(l, r);
    }
    moguc(g, poklon, n, q);
       
    return 0;
}