Harryxun/stf_run huggingface dataset:
n = int(input())
now_time = 0
global tf
tf = False

def finish_work(now_time, works):
    global tf
    if len(works) == 0:
        tf = True
        return True

    sums = sum([i[0] for i in works]) 
    maxs = max ([i[1] for i in works])
    if maxs < sums:
        return 0

    for index, i in enumerate(works):
        work_list = works.copy()
        work_list.pop(index)
        if now_time + i[0] <= i[1]:
            finish_work(now_time + i[0], work_list)

works = []

for i in range(n):
    a = list(map(int, input().split()))
    works.append(a)

for index, i in enumerate(works):
    work_list = works.copy()
    work_list.pop(index)
    if now_time + i[0] <= i[1]:
        finish_work(now_time + i[0], work_list)

if tf:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = int(input())
li = [list(map(int, input().split())) for _ in range(n)]
li.sort(key = lambda x : x[1])
t = 0
for i in li:
    t += i[0]
    if t > i[1]:
        print("No")
        break
else:
    print("Yes")
from collections import Counter

cnt = 0
trade = Counter()
while 1:
    line = raw_input()
    if not line:
        break
    cnt += 1
    a, b = map(int, line.split(','))
    trade[a] += 1

for i in xrange(cnt):
    a, b = map(int, raw_input().split(','))
    trade[a] += 1

for k, v in sorted(trade.items()):
    print k, v

### FIXED CODE ###

from collections import Counter

trade1 = Counter()
trade2 = Counter()
while 1:
    line = raw_input()
    if not line:
        break
    a, b = map(int, line.split(','))
    trade1[a] += 1

while 1:
    try:
        a, b = map(int, raw_input().split(','))
    except EOFError:
        break
    trade2[a] += 1

trade = trade1 + trade2
for k in sorted(trade1 & trade2):
    print k, trade[k]
from bisect import *
from collections import *
from fractions import gcd
from math import factorial
def permutations_count(n, r):
    if not n>=r>=0:
        return(0)
    else:
        return factorial(n) // factorial(n - r)
def combinations_count(n, r):
    if not n>=r>=0 or n<=0:
        return(0)
    elif r==0:
        return(1)
    else:
        return factorial(n) // (factorial(n - r) * factorial(r))
N=input()
K=int(input())
if length<K:
    print(0)
    exit()
length=len(str(N))
count=0
count3=0
flag=1
for i in range(length):
    if N[i]!="0":
        if i<length-1:
            if K-count3 >=0:count+=combinations_count(length-1-count3,K-count3)*(9**(K-count3))
            if K-count3-1 >=0:count+=combinations_count(length-1-count3,K-count3-1)*(9**(K-1-count3))*(int(N[i])-1)
            count3+=1
    if K-count3==0:
        count+=1
        #count+=int(N[i])
        break
    if i==length-1:
        count+=int(N[i])
print(count)


### FIXED CODE ###

from bisect import *
from collections import *
from fractions import gcd
from math import factorial
def permutations_count(n, r):
    if not n>=r>=0:
        return(0)
    else:
        return factorial(n) // factorial(n - r)
def combinations_count(n, r):
    if not n>=r>=0 or n<0:
        return(0)
    elif r==0:
        return(1)
    else:
        return factorial(n) // (factorial(n - r) * factorial(r))
N=input()
K=int(input())
length=len(str(N))
count=0
count3=0
flag=1
for i in range(length):
    if N[i]!="0":
        if K-count3 >=1:count+=combinations_count(length-1-i,K-count3)*(9**(K-count3))
        if K-count3-1 >=0:count+=combinations_count(length-1-i,K-count3-1)*(9**(K-1-count3))*(int(N[i])-1)
        count3+=1
    if K-count3==0:
        count+=1
        #count+=int(N[i])
        break
print(count)
c = input()
if c in [a, i, u, e, o]:
  print("vowel")
else:
  print("consonant")

### FIXED CODE ###

c = input()
if c in ["a", "i", "u", "e", "o"]:
  print("vowel")
else:
  print("consonant")
from queue import Queue

def inside(x, l, r):
    return l <= x < r

if __name__ == '__main__':
    h, w = map(int, input().split())

    a = [input() for _ in range(h)]

    qu = Queue()

    nokori = h*w
    for i in range(h):
        for j in range(w):
            if a[i][j] == '#':
                nokori -= 1
                qu.put(i*w + j)

    ans = 0
    dx = [0, 1, 0, -1]
    dy = [1, 0, -1, 0]
    while nokori:
        ans += 1
        qu2 = Queue()
        while not qu.empty():
            i0, j0 = divmod(qu.get(), w)
            for k in range(4):
                ni = i0 + dx[k]
                nj = j0 + dy[k]
                if not (inside(ni, 0, h) and inside(nj, 0, w)):
                    continue
                if a[ni][nj] == '.':
                    a[ni][nj] = '#'
                    nokori -= 1
                    qu2.put(ni*w+nj)
        qu = qu2
    print(ans)


### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
G = [input() for _ in range(H)]
dist = [0]*(H*W)
bn = 0
B = deque()
geta = W
for i, g in enumerate(G):
    for j, f in enumerate(g):
        if f == '#':
            bn += 1
            B.append(i*geta + j)
visited = set(B)
while bn < H*W:
    if not B:
        break
    dh, dw = divmod(B.pop(), geta)
    dhw = dh * geta + dw
    for di, dj in ((1, 0), (-1, 0), (0, 1), (0, -1)):
        ni, nj = dh + di, dw + dj
        if not (0 <= ni <= H - 1) or not (0 <= nj <= W - 1):
            continue
        nij = ni * geta + nj
        if nij in visited or G[ni][nj] == '#':
            continue
        visited.add(nij)
        dist[nij] = 1 + dist[dhw]
        B.appendleft(nij)
print(max(dist))
b = input()

if b=='A':
  print('T')
  
elif b=='G':
  print(C')
  
elif b=='T':
  print('A')
elif b=='C':
  print('G') 

### FIXED CODE ###

b = input()

if b=='A':
  print('T')
  
elif b=='G':
  print('C')
  
elif b=='T':
  print('A')
elif b=='C':
  print('G')
import sys
S = input()
S = S[::-1]
while S:
    if S[:3]=="res":
        if S[:6]=="resare":
            S = S[6:]
            print(S)
        else:
            print("NO")
            sys.exit()

    elif S[:3]=="esa":
        if S[:5]=="esare":
            S = S[5:]
            print(S)
        else:
            print("NO")
            sys.exit()
    
    elif S[:3]=="rem":
        if S[:7]=="remaerd":
            S = S[7:]
            print(S)
        else:
            print("NO")
            sys.exit()
        
    elif S[:3]=="mae":
        if S[:5]=="maerd":
            S = S[5:]
            print(S)
        else:
            print("NO")
            sys.exit()
            
    else:
        print("NO")
        sys.exit()
else:
    print("YES")

### FIXED CODE ###

import sys
S = input()
S = S[::-1]
while S:
    if S[:3]=="res":
        if S[:6]=="resare":
            S = S[6:]
#             print(S)
        else:
            print("NO")
            sys.exit()

    elif S[:3]=="esa":
        if S[:5]=="esare":
            S = S[5:]
#             print(S)
        else:
            print("NO")
            sys.exit()
    
    elif S[:3]=="rem":
        if S[:7]=="remaerd":
            S = S[7:]
#             print(S)
        else:
            print("NO")
            sys.exit()
        
    elif S[:3]=="mae":
        if S[:5]=="maerd":
            S = S[5:]
#             print(S)
        else:
            print("NO")
            sys.exit()
            
    else:
        print("NO")
        sys.exit()
else:
    print("YES")
S = int(input())
if S == "AAA" or "BBB":
  print("No")
else:
  print("Yes")

### FIXED CODE ###

S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
A, B, N = list(map(int,input().split()))
if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)

### FIXED CODE ###

import math

A, B, N = list(map(int,input().split()))

def f(x):
    return math.floor(A * x / B) - A * math.floor(x / B)

if B - 1 <= N:
    ans = f(B - 1)
else:
    ans = f(N)
print(ans)
# D TLE
import itertools
import bisect

N = map(int, input().split())
L = list(map(int, input().split()))

L.sort()
value = 0

for i, j in itertools.combinations(range(len(L-1)), 2):
    index = bisect.bisect_left(L[j+1:], L[i]+L[j])
    value+=index

print(value)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()
 
from bisect import bisect_left
ans = 0
for i in range(n):
  for j in range(i+1, n):
    t = l[i]+l[j]
    idx = bisect_left(l, t)
    ans += max(0, idx-j-1)
print(ans)
def code_for_D(test=None):

    N = int(input())

    works = [map(int, input().split()) for _ in range(N)]
    works = sorted(works, key=lambda x: x[1])

    time_now = 0
    time_by = 0
    answer = 'Yes'

    for i in range(N):
        time_now += works[0]
        time_by = works[1]
        
        if time_now > time_by:
            answer = 'No'
        
    print(answer)


def main():
    code_for_C()


if __name__ == '__main__':
    main()


### FIXED CODE ###

def code_for_D(test=None):

    N = int(input())

    works = [list(map(int, input().split())) for _ in range(N)]
    works = sorted(works, key=lambda x: x[1])

    time_now = 0
    answer = 'Yes'

    for work in works:
        time_now += work[0]
        time_by = work[1]

        if time_now > time_by:
            answer = 'No'

    print(answer)


def main():
    code_for_D()


if __name__ == '__main__':
    main()
S = [int(input()) for _ in range(5)]
l=[]
m=10
for i in range(5):
    if (S[i]%10)<m and S[i]%10!=0:
        m=S[i]%10
        a=S[i]
        j=i
for i in range(5):
    if  i!=j:
        if S[i]%10!=0:
            S[i]+=10-(S[i]%10)
        l.append(S[i])
l.append(a)
print(sum(l))

### FIXED CODE ###

S = [int(input()) for _ in range(5)]
l=[]
m=10
for i in range(5):
    if (S[i]%10)<m and S[i]%10!=0:
        m=S[i]%10
        a=S[i]
        j=i
if m==10:
    a=S[0]  
    j=0      
for i in range(5):
    if  i!=j:
        if S[i]%10!=0:
            S[i]+=10-(S[i]%10)
        l.append(S[i])
l.append(a)
print(sum(l))
h, a = map(int, input().split())
print(h // a + boll(h % a))

### FIXED CODE ###

h, a = map(int, input().split())
print(h // a + bool(h % a))
height = int(input())
width = int(input())

for hindex in range(height):
    x = input()
    print(x)
    print(x)


### FIXED CODE ###

(height, weight) = tuple(input().split(' '))

for hindex in range(int(height)):
    x = input()
    print(x)
    print(x)
print)(len(set(list(map(int,input().split()))))

### FIXED CODE ###

print(len(set(list(map(int,input().split())))))
A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*A + 100*B + 50*C:
				answer++
print(answer)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*i + 100*j + 50*k:
				answer+=1
print(answer)
s = list(input())

t = list("AKIHABARA")
cnt = 0

if len(s) > len(t):
    print("NO")
    exit()

for i in range(len(s)):
    if s[i] == t[cnt]:
        cnt += 1
        continue
    else:
        if t[cnt] == "A":
            cnt += 1
            if t[cnt] == s[i]:
                cnt += 1
                continue
            else:
                print("NO")
                eixt()
        else:
            print("NO")
            exit()
            
if cnt >= 7:
    print("YES")
else:
    print("NO")
            

### FIXED CODE ###

s = input()

check = ["KIHBR","KIHBRA","KIHBAR","KIHBARA","KIHABR","KIHABRA","KIHABAR","KIHABARA","AKIHBR","AKIHBRA","AKIHBAR","AKIHBARA","AKIHABR","AKIHABRA","AKIHABAR","AKIHABARA"]

if s in check:
    print("YES")
else:
    print("NO")
n,a=map(int,input().split())


while n > 500:
    n-=500
if n<=a:
    print("Yes")
else:
    print("No")        

### FIXED CODE ###

n=int(input())
a=int(input())
while n>=500:
  n-=500
if n<=a:
  print("Yes")
else:
  print("No")
mod = 10**9+7
N,K = map(int,input().split())

A = sorted(list(map(int,input().split())))

p = 1
m = 0
ans = 1
cnt = 0

while cnt < K-1:
  if A[m]*A[m+1] > A[-p]*A[-p-1]:
    ans*= A[ni]*A[n+1]%mod
    m += 2
    cnt += 2
    
  else:
    ans *= A[-p]%mod
    p += 1
    cnt += 1
    
if cnt == k-1:
  ans *= A[-p]%mod
  
if A[-1]<0 and K%2 == 1:
  ans = 1
  for i in A[N-K:]:
    ans*= i%mod
    
print(ans)

### FIXED CODE ###

from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=0
ans=1
i=0
while i<k-1:
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
    i+=2
  else:
    ans=ans*a[-pi]%p
    pi+=1
    i+=1
if i==k-1:
  ans=ans*a[-pi]%p
if a[-1]<0 and k%2==1:
  ans=1
  for i in a[n-k:]:
    ans=ans*i%p
print(ans)
from functools import lru_cache
import sys
MOD = 998244353


@lru_cache(maxsize=3100)
def pow_mod(i):
    # pow(2, i - 1, MOD)
    if i == 1:
        return 1
    else:
        return pow_mod(i - 1) * 2 % MOD


def main():
    input = sys.stdin.buffer.readline
    n, s = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [[None] * (s + 1) for _ in range(n + 1)]
#     dp[i][j]:=集合{1..i}の空でない部分集合T全てについて,和がjとなる部分集合の個数の和
    for i in range(n + 1):
        for j in range(s + 1):
            if i == 0 or j == 0:
                dp[i][j] = 0
                continue
            if j > a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + dp[i - 1][j - a[i - 1]]
            elif j == a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + pow_mod(i)
            else:
                dp[i][j] = dp[i - 1][j] * 2
            dp[i][j] %= MOD
    print(dp[n][s])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
MOD = 998244353


def main():
    input = sys.stdin.buffer.readline
    n, s = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [[None] * (s + 1) for _ in range(n + 1)]
#     dp[i][j]:=集合{1..i}の空でない部分集合T全てについて,和がjとなる部分集合の個数の和
    for i in range(n + 1):
        for j in range(s + 1):
            if i == 0 or j == 0:
                dp[i][j] = 0
                continue
            if j > a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + dp[i - 1][j - a[i - 1]]
            elif j == a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + pow(2, i - 1, MOD)
            else:
                dp[i][j] = dp[i - 1][j] * 2
            dp[i][j] %= MOD
    print(dp[n][s])


if __name__ == '__main__':
    main()
n = int(input())
t = list(map(int, input().split()))
m = int(input())

for _ in range(m):
    temp = t.copy()
    p, x = map(int, input().split())
    temp[p-1] = x
    print(sum(temp))

### FIXED CODE ###

import copy

n = int(input())
t = list(map(int, input().split()))
m = int(input())

for _ in range(m):
    temp = copy.copy(t)
    p, x = map(int, input().split())
    temp[p-1] = x
    print(sum(temp))
import math

# 最小公倍数lcm（ least common multiple）を返す関数は用意されていない
# が、lcm(a, b) = a * b / gcd(a, b)で求められる

A, B = map(int, input().split())
ans = A * B // math.gcd(A, B)
print(ans)


### FIXED CODE ###

import fractions

# 最小公倍数lcm（ least common multiple）を返す関数は用意されていない
# が、lcm(a, b) = a * b / gcd(a, b)で求められる

A, B = map(int, input().split())
ans = A * B // fractions.gcd(A, B)
print(ans)
# 初期入力
import sys
input = sys.stdin.readline
X,N = (int(i) for i in input().split())
if N !=0:
    p = list(map(int, input().split()))
else:
    p=[-1]
#
ans =[]
for i in range(1,101):
    if i not in p:
        ans.append((abs(i-X),i))
ans.sort()
print(ans[0][1])
aa=0

### FIXED CODE ###

# 初期入力
import sys
input = sys.stdin.readline
X,N = (int(i) for i in input().split())
if N !=0:
    p = list(map(int, input().split()))
elif N ==0:
    p=[-1]
p.sort()
#
ans =[]
for i in range(-1,102):
    if i not in p:
        ans.append((abs(i-X),i))
ans.sort()
print(ans[0][1])
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(x):
    if i[j]<(k/(4*(j+1))):
        pass
    else:
        flag+=1
if flag!=y:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

n=input()
if n=="AAA" or n=="BBB":
    print("No")
else:
    print("Yes")
n = (int,raw_input())
 
numlist = map(int, raw_input().split())
numlist = sort(numlist)
for x in numlist
 print x,

### FIXED CODE ###

n = input()
for i in sorted(map(int, raw_input().split())):
 print i ,
N, a = map(int, input().split())
x = list(map(int, input().split()))
dp = [[[0]*(50*N+1) for _ in range(N+1)] for _ in range(N+1)]
for i in range(N+1):
    for j in range(N+1):
        for k in range(50*N+1):
            if i == 0 and j == 0 and k == 0:
                dp[i][j][k] = 1
            elif i and k < x[i-1]:
                dp[i][j][k] = dp[i-1][j][k]
            elif i and j and k >= x[i-1]:
                dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-x[i-1]]
ans = 0
for j in range(1, N+1):
    ans += dp[N][j][a*j]
print(ans)



### FIXED CODE ###

N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N <= K:
    print(N * X)
else:
    print(K * X + (N - K) * Y)
N = int(input())

alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = alp[(alp.index(N) + 1)]
print(ans)


### FIXED CODE ###

S = input()

alp = 'abcdefghijklmnopqrstuvwxyz'
ans = alp[(alp.index(S) + 1)]
print(ans)
n=int(inpt())
x=800*n
y=(n//15)*200
print(x-y)

### FIXED CODE ###

n=int(input())
x=800*n
y=(n//15)*200
print(x-y)
L1 = input().split(" ")
score = [int(L1[1])-int(L1[2])]*(int(L1[0])-1)
for i in range(int(L1[2])):
    A = int(input()) - 1
    score[A] += 1

for j in score:
    if j > 0:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

L1 = input().split(" ")
L12 = int(L1[2])
score = [int(L1[1])-L12]*(int(L1[0]))
for i in range(L12):
    A = int(input()) - 1
    score[A] += 1

for j in score:
    if j > 0:
        print("Yes")
    else:
        print("No")
from __future__ import print_function
import sys

def # eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


n=int(input())
S=list(input())

cnt_temp=0
cnt_temp2=0
stack=[]
cnt=0

# # eprint(n)
# # eprint(S)

# for i in range(n):
#     # eprint(i)


flag=0
flag2=0
start=0

for i in range(n):
    if S[i] == '.':
        cnt_temp+=1



if S[0] == '.':
    flag =1
# eprint("flag: ",end="")
# eprint(flag)

if flag==1:
    for i in range(n-1):
        if S[i]=='#' and S[i+1]=='.':
            flag2=1
            for j in range(i+1,n):
                if S[j] =='.':
                    cnt_temp2+=1
            break
# eprint("flag2: ",end="")
# eprint(flag2)
        

        
for _ in S:
    print( _ , end="")
print()
        
for i in range(n-1):
    if S[i]=='#' and S[i+1]=='#':
        stack.append(i)
    elif S[i]=='#' and S[i+1]=='.':
        
        S[i]='.'
        cnt+=1
        
        for _ in S:
            # eprint(_,end="")
        # eprint()
        
        
        
        while stack!=[]:
            temp=stack.pop()
            S[temp]='.'
            cnt+=1
            for _ in S:
                # eprint(_,end="")
            # eprint()

            
        
# eprint("cnt: ",end="")
# eprint(cnt)
# eprint("cnt_temp2: ",end="")
# eprint(cnt_temp2)

print(min(cnt,cnt_temp,cnt_temp2))
            #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #


### FIXED CODE ###

from __future__ import print_function
import numpy as np
import sys

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

n=int(input())
S=list(input())
array0=np.zeros(n,dtype=int)
array1=np.zeros(n,dtype=int)
array2=np.zeros(n,dtype=int)

array0[0]= 1 if S[0]=='#' else 0
for i in range(1,n):
    array0[i]= array0[i-1]+1 if S[i]=='#' else array0[i-1]


array1[n-1]= 1 if S[n-1]=='.' else 0
for i in range(n-2,-1,-1):
    array1[i]= array1[i+1]+1 if S[i]=='.' else array1[i+1]
    
for i in range(0,n):
    array2[i]=array0[i]+array1[i]
eprint(array0)
eprint(array1)
eprint(array2)
    
print(min(array2)-1)
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
from itertools import permutations
 
N,M,R = map(int, input().split())
r = list(map(int,input().split()))
 
dis = [[float('inf')]*(N+1) for _ in range(N+1)]
for i in range(1, N+1):
	dis[i][i] = 0
for i in range(M):
    Ai, Bi, Ci = map(int, input().split())
    if dis[Ai][Bi] > Ci:
        dis[Ai][Bi] = Ci
        dis[Bi][Ai] = Ci
for k in range(1, N+1):    # Warshall-Floyd
    for i in range(1, N+1):
        for j in range(i, N+1):
            if dis[i][j] > dis[i][k] + dis[k][j]:
                dis[i][j] = dis[i][k] + dis[k][j]
 
ans = float('inf')
for p in permutations(r):
    cnt = 0
    for i in range(len(p)-1):
        cnt += dis[p[i]][p[i+1]]
    ans = min(ans, cnt)
print(ans)

### FIXED CODE ###

N = int(input())
n10 = N//10
n1 = N%10
if n10 == 9 or n1 == 9:
    print("Yes")
else:
    print("No")
N = int(input())
s = 0
t = 0
u = 0
A = []
for i in range(N):
  m = input()
  A.append(m)
  u += m.count("AB")
  if m[0] == B:
    s += 1
  if m[-1] == A:
    t += 1
u += min(s, t)
print(u)

### FIXED CODE ###

N = int(input())
s = 0
t = 0
u = 0
v = 0
for i in range(N):
    m = input()
    u += m.count("AB")
    if m[0] == "B" and m[-1] == "A":
        v += 1
    else:
        if m[0] == "B":
            s += 1
        if m[-1] == "A":
            t += 1
if s == 0 and t == 0 and v != 0:
    u += v - 1
    print(u)
elif s == 0 or t == 0:
    u += v
    print(u)
else: 
    u += min(s - 1, t - 1) + v + 1
    print(u)
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=1
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    s=str(input())
    v=s.count('o')
    v+=15-len(s)
    if(v<8):
        print("NO")
    else:
        print("YES")
    #n,k,s= map(int, sys.stdin.readline().split(' '))
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

### FIXED CODE ###

#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    s=str(input())
    v=s.count('o')
    v+=15-len(s)
    if(v<8):
        print("NO")
    else:
        print("YES")
    #n,k,s= map(int, sys.stdin.readline().split(' '))
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()
n = input()
x = int(input())
fx = 0
for i in n:
  fx += int(i)
print('Yes' if x%fx ==0 else 'No')

### FIXED CODE ###

n = input()
a = 0
for i in n:
  a += int(i)
print('Yes' if int(n) % a == 0 else 'No')
L,R=map(int,input().split())
l1=L//2019
l2=L%2019
r1=R//2019
r2=R%2019
if l1!=r1 or l2==0:
  print(0)
else:
  a = [2020]
  for i in range(l2,r2):
    for j in range(i+1,r2+1):
      c = (i*j)%2019
      a.append(c)
print(min(a))

### FIXED CODE ###

L,R=map(int,input().split())
l1=L//2019
l2=L%2019
r1=R//2019
r2=R%2019
if l1!=r1 or l2==0:
  print(0)
else:
  a = [2020]
  for i in range(l2,r2):
    for j in range(i+1,r2+1):
      c = (i*j)%2019
      a.append(c)
  print(min(a))
a=input()
b=input()
count=0
for i in range(3):
  if a[i]=b[i]:
    count+=1
print(count)

### FIXED CODE ###

a=input()
b=input()
count=0
for i in range(3):
  if a[i]==b[i]:
    count+=1
print(count)