#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int i, n;
  string s;
  cin >> n >> s;
  int m = (n - 11) / 2;
  int M = m;
  for (int i = 0; i < (int)(n); ++i) {
    if (m != 0 && s[i] == '8') {
      s[i] = 'a';
      m--;
    } else if (m == 0) {
      break;
    }
  }
  m = M;
  for (int i = 0; i < (int)(n); ++i) {
    if (m != 0 && s[i] != 'a' && s[i] != '8') {
      s[i] = 'a';
      m--;
    } else if (m == 0)
      break;
  }
  i = 0;
  while (s[i] == 'a') {
    i++;
  }
  if (s[i] == '8') {
    cout << "YES"
         << "\n";
  } else
    cout << "NO"
         << "\n";
  return 0;
}
