#include <bits/stdc++.h>
using namespace std;
int const N = 3e5 + 10, oo = 1e9;
long long const OO = 2e18;
double const eps = 1e-8, PI = acos(-1);
int mod = oo + 7;
int n;
string s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s;
  int cnt = 0;
  for (int i = 0; i < n - 10; i++) cnt += s[i] == '8';
  int er = n - 10;
  if (cnt > er / 2)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
