#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
const int maxm = 1000010;
const int INF = 0x3f3f3f3f;
int n, m;
char s[maxn];
bool vis[maxn] = {
    0,
};
bool check() {
  m = n - 11;
  m >>= 1;
  for (int i = 0, j = 0; i < n && j < m; ++i) {
    if (s[i] == '8') {
      vis[i] = true;
      j++;
    }
  }
  for (int i = 0, j = 0; i < n && j < m; ++i) {
    if (s[i] != '8') {
      vis[i] = true;
      j++;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (!vis[i]) return s[i] == '8';
  }
  return false;
}
int main() {
  scanf("%d %s", &n, s);
  if (check())
    printf("YES\n");
  else
    printf("NO\n");
}
