int main(){
    int n; cin>>n;
    vector<int>a(n);
    for(int i = 0; i < n;i++)cin >> a[i];
    int q;cin>>q;
    int bris = 0;
    for(int i = 0; i < q;i++){
        int q1, q2;cin>>q1>>q2;
        for(int i = q1; i <= q2-1;i++){
            if(a[i] < a[i-1]) bris++;
            if(bris>1) break;
        }
        if(bris<= 1)
            cout << "DA" << endl;
        else    
            cout << "NE" << endl;
        bris=0;
    }
    

    return 0;

}