#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, i, lim, cnt = 0, other = 0;
  string str;
  cin >> n >> str;
  lim = str.size();
  int petya = (n - 11) / 2;
  for (i = 0; i < lim; i++) {
    if (str[i] == '8')
      cnt++;
    else
      other++;
    if (cnt > petya) break;
  }
  if (cnt > petya && other <= petya)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
