#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  string s;
  cin >> n >> s;
  long long cnt = 0, c = (n - 11) / 2;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '8' && i + 11 <= n) cnt++;
  }
  if (cnt > c)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
