#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, i, j, k, count, c, t, z = 0;
  cin >> n;
  cin >> s;
  k = n - 11;
  if (k % 2 == 0)
    t = k / 2;
  else
    t = k / 2;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '8') {
      z++;
      if (z == t + 1) {
        c = i;
      }
    }
  }
  if (z >= t + 1) {
    if (c <= k)
      cout << "YES";
    else
      cout << "NO";
  } else
    cout << "NO";
}
