#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  string str;
  cin >> n;
  cin >> str;
  int len = n - 11;
  int coun = 0, cou = 0;
  for (int j = 0; j < len + 1; j++) {
    if (str[j] == '8') coun = 1, cou++;
    ;
  }
  if (cou > len / 2)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
