import java.util.*;
public class Winner{
    public static void main(String[] main){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        int ctr = 0,moves;
        for(int i = 0;i < n;i++){
            if(str.charAt(i) == '8'){
                ctr++;
            }
        }
        moves = n-11;
        if(moves % 2 == 0){
            moves/=2;
        }else{
            moves-=1;
            moves/=2;
        }
        if(moves >= ctr){
            System.out.print("NO");
        }else{
            System.out.print("YES");
        }
        
    }
}