#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 1000000;
const long long int MOD = 1e9 + 7;
long long int X[] = {0, 0, 1, -1};
long long int Y[] = {1, -1, 0, 0};
void solve() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  long long int cnt = 0;
  for (long long int i = 0; i < n - 10; ++i) {
    if (s[i] == '8')
      cnt++;
    else
      cnt--;
  }
  if (cnt > 0)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long int t = 1;
  while (t--) {
    solve();
  }
}
