#include <bits/stdc++.h>
using namespace std;
int n, c;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n - 10; i++) {
    if (s[i] == '8')
      c++;
    else
      c--;
  }
  if (c > 0)
    printf("YES");
  else
    printf("NO");
}
