#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, e, v, p, c = 0;
  string s;
  cin >> n >> s;
  e = n - 11;
  p = (e / 2);
  for (int i = 0; i <= e; i++) {
    if (s[i] == '8') c++;
  }
  if (c > p)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
