#include <bits/stdc++.h>
const int N = 5e5 + 10, M = 1e7 + 10;
const long long mod = 1e9 + 7;
using namespace std;
int cout1, cout2;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.size() - 10; i++) {
    if (s[i] == '8')
      cout1++;
    else
      cout2++;
  }
  if (cout2 >= cout1)
    puts("NO");
  else
    puts("YES");
  return 0;
}
