#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  long long n;
  cin >> n >> s;
  long long c8 = 0, x;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == '8') c8++;
  }
  x = (n - 11) / 2;
  if (c8 <= x) {
    cout << "NO\n";
    return 0;
  }
  string s2;
  long long idx = -1;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == '8' && x > 0) {
      x--;
      continue;
    }
    if (s[i] == '8' && x == 0) {
      idx = s2.size();
      break;
    }
    s2.push_back(s[i]);
  }
  x = (n - 11) / 2;
  if (idx > x) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
  return 0;
}
