#include <bits/stdc++.h>
using namespace std;
string s;
int n;
void input() { cin >> n >> s; }
void solve() {
  int x = 0;
  for (int i = 0; i < n - 10; i++)
    if (s[i] == '8') x++;
  if (x <= (n - 11) / 2)
    cout << "NO\n";
  else
    cout << "YES\n";
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  input();
  solve();
  return 0;
}
