#include <bits/stdc++.h>
using namespace std;
const long long N = 500000;
long long a[N], b[N];
int main() {
  ios_base::sync_with_stdio(false);
  long long n, i, z, counti, x = 0;
  string s;
  cin >> n;
  cin >> s;
  for (i = 0; i < n; i++) a[i] = (long long)s[i] - 48;
  z = (n - 11) / 2;
  counti = 0;
  for (i = 0; i < n; i++) {
    if (counti < z) {
      if (a[i] == 8) {
        a[i] = -1;
        counti++;
      }
    } else
      break;
  }
  counti = 0;
  for (i = 0; i < n; i++) {
    if (counti < z) {
      if ((a[i] != 8) && (a[i] != -1)) {
        a[i] = -1;
        counti++;
      }
    } else
      break;
  }
  for (i = 0; i < n; i++)
    if (a[i] != -1) {
      b[x] = a[i];
      x++;
    }
  if (b[0] == 8) {
    cout << "YES\n";
  } else
    cout << "NO\n";
  return 0;
}
