#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double Pi = 3.141592653589793116, EPS = 1e-9;
const long long dx[4] = {0, 1, 0, -1};
const long long dy[4] = {1, 0, -1, 0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string str;
  cin >> str;
  long long can = (n - 11) / 2;
  long long can2 = can;
  long long p = count(str.begin(), str.end(), '8');
  if (p <= can)
    cout << "NO\n";
  else {
    long long vis[100003] = {0};
    for (long long i = 0; can; i++) {
      if (str[i] == '8') {
        vis[i] = 1;
        can--;
      }
    }
    long long ct = 0;
    long long idx;
    for (long long i = 0; i < (long long)((str).size()); i++) {
      if (str[i] == '8' && vis[i] == 0) {
        idx = i;
        break;
      }
      if (str[i] != '8') ct++;
    }
    if (ct <= can2)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
