#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 5;
const int MOD = 1e9 + 7;
string a;
int main() {
  int n = 0;
  while (~scanf("%d", &n)) {
    cin >> a;
    int len = n - 11 + 1;
    int num = 0;
    for (int i = 0; i < len; i++) {
      if (a[i] == '8') {
        num++;
      }
    }
    if (num > len / 2) {
      puts("YES");
    } else {
      puts("NO");
    }
  }
  return 0;
}
