#include <bits/stdc++.h>
using namespace std;
inline void pin(int n) { printf("%d\n", n); }
double PI = acos(-1);
const int inf = 0x3f3f3f3f;
long long int StoI(string &s) {
  long long int sum = 0;
  for (long long int i = 0; i < s.size(); i++) {
    s[i] -= '0';
    sum = sum * 10 + s[i];
  }
  return sum;
}
long long int power(long long int a, long long int n) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long int power(long long int a, long long int n, long long int mod) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int co = 0;
  int co2 = 0;
  int tc = 0;
  for (int i = 0; i < n - 10; i++) {
    if (s[i] == '8') co++;
  }
  int option = n - 10;
  if (option & 1) {
    if (co == option) co--;
    option--;
  }
  if (co > option / 2)
    cout << "YES";
  else {
    cout << "NO";
  }
  return 0;
}
