#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1000;
char s[N];
int main() {
  ios::sync_with_stdio(0);
  int len;
  cin >> len;
  cin >> s + 1;
  int r = len - 11 + 1;
  int sum = 0;
  int k = (len - 11) / 2;
  for (int i = (1); i <= (r); i++)
    if (s[i] == '8') sum++;
  if (k >= sum)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
