A telephone number is a sequence of exactly $11$ digits such that its first digit is 8.

Vasya and Petya are playing a game. Initially they have a string $s$ of length $n$ ($n$ is odd) consisting of digits. Vasya makes the first move, then players alternate turns. In one move the player must choose a character and erase it from the current string. For example, if the current string 1121, after the player's move it may be 112, 111 or 121. The game ends when the length of string $s$ becomes 11. If the resulting string is a telephone number, Vasya wins, otherwise Petya wins.

You have to determine if Vasya has a winning strategy (that is, if Vasya can win the game no matter which characters Petya chooses during his moves).


-----Input-----

The first line contains one integer $n$ ($13 \le n < 10^5$, $n$ is odd) — the length of string $s$.

The second line contains the string $s$ ($|s| = n$) consisting only of decimal digits.


-----Output-----

If Vasya has a strategy that guarantees him victory, print YES.

Otherwise print NO.


-----Examples-----
Input
13
8380011223344

Output
YES

Input
15
807345619350641

Output
NO



-----Note-----

In the first example Vasya needs to erase the second character. Then Petya cannot erase a character from the remaining string 880011223344 so that it does not become a telephone number.

In the second example after Vasya's turn Petya can erase one character character 8. The resulting string can't be a telephone number, because there is no digit 8 at all.

Difficulty: interview

Starter code:

Solutions:
n, s = int(input()), input()
cnt = (n - 11) // 2
cnt_8 = len(s[:n - 10].split('8')) - 1
if (cnt >= cnt_8):
	print ("NO")
else:
	print ("YES")

def main():
    n = int(input())
    arr = list(map(int, input()))
    a = arr.count(8)
    if a <= (n - 11) // 2:
        print("NO")
        return 0
    i = -1
    cnt = 1 + (n - 11) // 2
    while cnt:
        i += 1
        if arr[i] == 8:
            cnt -= 1
    if i > n - 11:
        print("NO")
        return 0
    print("YES")
    return 0

main()

N = int(input())
S = input()
A, B = 0, 0
for i in range(N-10):
    if S[i] == "8":
        A += 1
    else:
        B += 1
if A > B:
    print("YES")
else:
    print("NO")


from collections import Counter

n = int(input())
s = list(input())

c = Counter(s[:-10])
if c['8'] > len(s[:-10]) // 2:
	print('YES')
else:
	print('NO')

n = int(input())
s = input()
cnt = 0
for i in range(n - 10):
    if s[i] == '8':
        cnt += 1
if cnt >= ((n - 9) // 2):
    print('YES')
else:
    print('NO')


from sys import *
from math import *
from collections import *

N = int(input())

S = input()


e = deque([])
n = deque([])

for i, v in enumerate(S):
    if v == '8':
        e += [i]
    else:
        n += [i]

todo = (N - 11) // 2

for i in range(todo):
    if len(n) != 0:
        n.popleft()
    else:
        e.pop()
        
    if len(e)!= 0:
        e.popleft()
    else:
        n.pop()

if len(e) != 0 and (len(n) == 0 or n[0] > e[0]):
    print("YES")
else:
    print("NO")




n = int(input())
s = input()
num = (n - 11) // 2
num2 = 0
num3 = -1
for i in range(n):
    if s[i] == "8":
        num2 += 1
        if num2 == num + 1:
            num3 = i
            break
if num3 == -1 or num3 > num * 2:
    print("NO")
else:
    print("YES")


n = int(input())
s = input()

cnt = 0
for i in range(n - 10):
	if s[i] == '8':
		cnt += 1
steps = (n - 11) // 2
if cnt <= steps:
	print("NO")
else:
	print("YES")

n = int(input())
s = input()
if s[:n-10].count('8')> (n-11)//2:
    print('YES')
else:
    print('NO')


n=int(input())
s=input()
t=s[:-10]
cnt=t.count('8')
if len(t)-cnt>=cnt:
    print('NO')
else:
    print('YES')

def main():
    n = int(input())
    s = input()
    eight = 0
    for i in range(n-11+1):
        if s[i] == '8':
            eight += 1

    if eight > (n-11)//2:
        print('YES')
    else:
        print('NO')

main()


n = int(input())
s = input()

torem = n - 11

if s[:torem+1].count('8') > (torem+1)//2:
    print('YES')
else:
    print('NO')


n, s = int(input()), input()
s = s[:n-10]
a = s.count('8')
b = len(s) - a
print('YES' if a >= b else 'NO')

if (int(input()) - 9) // 2 <= input()[:-10].count('8'):
    print("YES")
else:
    print("NO")


s = int(input())
string = input()
counter = 0
array = []
for i in range(len(string)):
    if string[i] == '8':
        counter += 1
        array.append(i)
if (s - 11) // 2 >= counter:
    print('NO')
elif (s - 11) // 2 < counter:
    if array[0] > (s - 11) // 2:
        print('NO')
    elif array[(s - 11) // 2] - ((s - 11) // 2) <= (s - 11) // 2:
        print('YES')
    elif array[(s - 11) // 2] - ((s - 11) // 2) > (s - 11) // 2:
        print('NO')
else:
    print('YES')

n = int(input())
x = input()

r = (n-11)//2
p = x[:2*r+1]
if p.count("8") >= r+1:
    print("YES")
else:
    print("NO")


n=int(input())
s=input()
t=s[:-10]
cnt=t.count('8')
if len(t)-cnt>cnt:
    print('NO')
else:
    print('YES')

import sys
input = sys.stdin.readline

N=int(input())
S=input().strip()

P=(N-11)//2

from collections import deque
L=deque(S)
count=0

for j in range(P):
    while len(L)!=0 and L[0]=="8":
        L.popleft()
        count+=1

    if len(L)==0:
        print("YES")
        return

    L.popleft()

    while len(L)!=0 and L[0]=="8":
        L.popleft()
        count+=1

if count>P:
    print("YES")
else:
    print("NO")


import sys
n = int(input())
s = input()
k = (n - 11) // 2
licz = 0
for i in range(n):
	if s[i] == '8':
		licz += 1
if licz <= k:
	print("NO")
	return
licz = 0
i = -1
while True:
	i += 1
	if s[i] == '8':
		licz += 1
	if licz == k + 1:
		break
if i > 2 * k:
	print("NO")
else:
	print("YES")

n = int(input())
s = str(input())
count = 0
p = []
for i in range(n):
	if s[i] == "8":
		count+=1
		p.append(i)
moves = int((n - 11)/2)
if moves >= count:
	print("NO")
	return
else:
	if p[moves] <= 2*moves:
		print("YES")
	else:
		print("NO")  



input()
s=input()
not8=[i for i, c in enumerate(s) if c!='8']
is8=[i for i, c in enumerate(s) if c=='8']

n=len(s)
moves=(n-11)//2

if moves >= len(not8):
    print('YES')
    raise SystemExit(0)
if moves >= len(is8):
    print('NO')
    raise SystemExit(0)

not8 = not8[moves:]
is8 = is8[moves:]

# print(not8, is8)

if is8[0] < not8[0]:
    print('YES')
    raise SystemExit(0)
else:
    print('NO')
    raise SystemExit(0)


''' CODED WITH LOVE BY SATYAM KUMAR '''

from sys import stdin, stdout
import cProfile, math
from collections import Counter,defaultdict
from bisect import bisect_left,bisect,bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
sys.setrecursionlimit(10**6) # max depth of recursion
threading.stack_size(2**27)  # new thread will get stack of such size
fac_warmup = False
printHeap = str()
memory_constrained = False
P = 10**9+7
import sys

class merge_find:
    def __init__(self,n):
        self.parent = list(range(n))
        self.size = [1]*n
        self.num_sets = n
        self.lista = [[_] for _ in range(n)]
    def find(self,a):
        to_update = []
        while a != self.parent[a]:
            to_update.append(a)
            a = self.parent[a]
        for b in to_update:
            self.parent[b] = a
        return self.parent[a]
    def merge(self,a,b):
        a = self.find(a)
        b = self.find(b)
        if a==b:
            return
        if self.size[a]<self.size[b]:
            a,b = b,a
        self.num_sets -= 1
        self.parent[b] = a
        self.size[a] += self.size[b]
        self.lista[a] += self.lista[b]
    def set_size(self, a):
        return self.size[self.find(a)]
    def __len__(self):
        return self.num_sets

def display(string_to_print):
    stdout.write(str(string_to_print) + "\n")

def primeFactors(n): #n**0.5 complex 
    factors = dict()
    for i in range(2,math.ceil(math.sqrt(n))+1):  
        while n % i== 0: 
            if i in factors:
                factors[i]+=1
            else: factors[i]=1
            n = n // i 
    if n>2:
        factors[n]=1
    return (factors)

def fibonacci_modP(n,MOD):
    if n<2: return 1
    #print (n,MOD)
    return (cached_fn(fibonacci_modP, (n+1)//2, MOD)*cached_fn(fibonacci_modP, n//2, MOD) + cached_fn(fibonacci_modP, (n-1) // 2, MOD)*cached_fn(fibonacci_modP, (n-2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n , p): 
    if (p <= n): 
        return 0
    res = (p - 1) 
    for i in range (n + 1, p): 
        res = (res * cached_fn(InverseEuler,i, p)) % p 
    return res 

def binary(n,digits = 20):
    b = bin(n)[2:]
    b = '0'*(20-len(b))+b
    return b

def isprime(n):
    """Returns True if n is prime."""
    if n < 4:
        return True
    if n % 2 == 0:
        return False
    if n % 3 == 0:
        return False
    i = 5
    w = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += w
        w = 6 - w
    return True
factorial_modP = []
def warm_up_fac(MOD):
    nonlocal factorial_modP,fac_warmup
    if fac_warmup: return
    factorial_modP= [1 for _ in range(fac_warmup_size+1)]
    for i in range(2,fac_warmup_size):
        factorial_modP[i]= (factorial_modP[i-1]*i) % MOD
    fac_warmup = True

def InverseEuler(n,MOD):
    return pow(n,MOD-2,MOD)

def nCr(n, r, MOD):
    nonlocal fac_warmup,factorial_modP
    if not fac_warmup:
        warm_up_fac(MOD)
        fac_warmup = True
    return (factorial_modP[n]*((pow(factorial_modP[r], MOD-2, MOD) * pow(factorial_modP[n-r], MOD-2, MOD)) % MOD)) % MOD

def test_print(*args):
    if testingMode:
        print(args)

def display_list(list1, sep=" "):
    stdout.write(sep.join(map(str, list1)) + "\n")

def display_2D_list(li):
    for i in li:
        print(i)
def prefix_sum(li):
    sm = 0
    res = []
    for i in li:
        sm+=i
        res.append(sm)
    return res

def get_int():
    return int(stdin.readline().strip())

def get_tuple():
    return map(int, stdin.readline().split())

def get_list():
    return list(map(int, stdin.readline().split()))
import heapq,itertools
pq = []                         # list of entries arranged in a heap
entry_finder = {}               # mapping of tasks to entries
REMOVED = '<removed-task>' 
def add_task(task, priority=0):
    'Add a new task or update the priority of an existing task'
    if task in entry_finder:
        remove_task(task)
    count = next(counter)
    entry = [priority, count, task]
    entry_finder[task] = entry
    heapq.heappush(pq, entry)

def remove_task(task):
    'Mark an existing task as REMOVED.  Raise KeyError if not found.'
    entry = entry_finder.pop(task)
    entry[-1] = REMOVED

def pop_task():
    'Remove and return the lowest priority task. Raise KeyError if empty.'
    while pq:
        priority, count, task = heapq.heappop(pq)
        if task is not REMOVED:
            del entry_finder[task]
            return task
    raise KeyError('pop from an empty priority queue')
memory = dict()
def clear_cache():
    nonlocal memory
    memory = dict()
def cached_fn(fn, *args):
    nonlocal memory
    if args in memory:
        return memory[args]
    else:
        result = fn(*args)
        memory[args] = result
        return result

def ncr (n,r):
    return math.factorial(n)/(math.factorial(n-r)*math.factorial(r))
def binary_serach(i,li):
    #print("Search for ",i)
    fn = lambda x: li[x]-x//i
    x = -1
    b = len(li)
    while b>=1:
        #print(b,x)
        while b+x<len(li) and fn(b+x)>0: #Change this condition 2 to whatever you like
            x+=b
        b=b//2
    return x

# -------------------------------------------------------------- MAIN PROGRAM
TestCases = False
testingMode = False
fac_warmup_size = 10**5+100
optimiseForReccursion = True #Can not be used clubbed with TestCases # WHen using recursive functions, use Python 3
from math import factorial

def main():
    n = get_int()
    st = list(input())
    x = (n-11)//2
    y = x
    li = []
    for i in st:
        if i!='8':
            li.append(i)
        else:
            x-=1
            if x==-1:
                break
    print("YES") if len(li)<=y else print("NO")

# --------------------------------------------------------------------- END=


if TestCases: 
    for i in range(get_int()): 
        cProfile.run('main()') if testingMode else main(i) 
else: (cProfile.run('main()') if testingMode else main()) if not optimiseForReccursion else threading.Thread(target=main).start()

N = int(input())
S = input()
turns = (N - 11) // 2
cnt = 0
for i in range(N - 10):
    if S[i] == '8':
        cnt += 1
if cnt >= turns + 1:
    print("YES")
else:
    print("NO")

# coding: utf-8
import sys
from heapq import heappush, heappop, heapify
sys.setrecursionlimit(int(1e7))

def main():
    n = int(input().strip())
    s = input().strip()
    V = [i for i in range(n) if s[i]!='8']
    P = [i for i in range(n) if s[i]=='8']
    heapify(V)
    heapify(P)
    while len(V)+len(P)>11 and len(V)*len(P)>0:
        heappop(V)
        heappop(P)
    yes = len(V)==0 or (len(V)*len(P)>0 and P[0]<V[0])
    print('YES' if yes else 'NO')
    return

while 1:
    try: main()
    except EOFError: break

n = int(input())
x = list(input())
a = (n-11+1)//2
b = (n-11)//2
for i,ch in enumerate(x):
    if ch == '8':
        if b > 0:
            b -= 1
            x[i] = None
    else:
        if a > 0:
            a -= 1
            x[i] = None
for c in x:
    if c != None:
        if c != '8':
            print("NO")
        else:
            print("YES")
        break