#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
string str;
int num[MAXN];
int N;
int main() {
  scanf("%d", &N);
  cin >> str;
  for (int i = 0; i < N; i++) num[i + 1] = str[i] - '0';
  int ans = 0;
  int len = N - 10;
  for (int i = 1; i <= len; i++) {
    if (num[i] == 8) ans++;
  }
  if (ans >= ((len + 1) / 2))
    puts("YES");
  else
    puts("NO");
  return 0;
}
