#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
void swap(long long *x, long long *y) {
  long long temp = *x;
  *x = *y;
  *y = temp;
}
int main() {
  long long i, j, k, x = 1, x1, x2, x3, y, y1, y2, y3, n, m;
  long long flag = 0, f = 0, sum = 0, count = 0, ans = 0, diff = 0, prod = 0,
            count1 = 0, count2 = 0;
  cin >> n;
  string s;
  cin >> s;
  x = (n - 11) / 2 + 1;
  for (i = 0; i <= n - 11; i++) {
    if (s[i] == '8') count++;
  }
  if (count >= x)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
