#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const int mod = 1e9 + 7;
int n, ind[N];
char s[N];
int main() {
  while (~scanf("%d%s", &n, s)) {
    int c = 0, out = 0;
    int m = (n - 11) / 2;
    for (int i = 0; i <= n - 1; i++)
      if (s[i] == '8') {
        c++;
        ind[c] = i + 1;
      } else if (c <= m)
        out++;
    if (c <= m)
      puts("NO");
    else {
      if (out > m)
        puts("NO");
      else
        puts("YES");
    }
  }
  return 0;
}
