Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

total = 0
   
for i in range(1,int(math.sqrt(N)+1)):
    amari = i
    if N % amari == 0:
        k = N // amari - 1
        if amari == N % k:
            total += N//amari - 1
        #print(amari)

print(total)

Fixed submission:
import math

N = int(input())

total = 0
   
if N != 1:        
    for i in range(1,int(math.sqrt(N)+1)):
        amari = i
        if N % amari == 0:
            k = N // amari - 1
            if amari == N % k:
                total += N//amari - 1
        #print(amari)

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()

begginingLength = len(S)

while "01" in S:
    S = S.replace("01","")

while "10" in S:
    S = S.replace("10","")

endLength = len(S)

ans = begginingLength - endLength
print(ans)


Fixed submission:
S = input()

ones = S.count("1")
zeros = S.count("0")

ans = min(ones,zeros)*2
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(N):
    x,u = input().split()
    if u == "JPY":
        total += int(x)
    else:
        total += int(x)*380000

print(total)

Fixed submission:
N = int(input())
total = 0
for i in range(N):
    x,u = input().split()
    if u == "JPY":
        total += int(x)
    else:
        total += float(x)*380000

print(total)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = [int(i) for i in input().split()]

gcd = A[0]

for i in range(1,len(A)):
    gcd = math.gcd(gcd,A[i])

print(gcd)

Fixed submission:
import fractions

N = int(input())
A = [int(i) for i in input().split()]

gcd = A[0]

for i in range(1,len(A)):
    gcd = fractions.gcd(gcd,A[i])

print(gcd)
Buggy python submission (verdict: Time Limit Exceeded):
def countup(S,x):
    counting = S[:x]
    return counting.count("B")



S = input()

count = 0
for i in range(len(S)):
    if S[i] == "W":
        count += countup(S,i)

print(count)

Fixed submission:
S = input()

count = 0
countB = 0
for i in range(len(S)):
    if S[i] == "B":
        countB += 1
    else:
        count += countB

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def change(S):
    for i in range(len(S)-1):
        if S[i] == "B" and S[i+1] == "W":
            ans = S[:i] + "WB" + S[i+1+1:]
            break
    return ans


S = input()

count = 0
while "BW" in S:
    S = change(S)
    count += 1

print(count)



Fixed submission:
S = input()

count = 0
countB = 0
for i in range(len(S)):
    if S[i] == "B":
        countB += 1
    else:
        count += countB

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import math
N,K = (int(i) for i in input().split())

count = 0
minus = []
for i in range(1,N+1):
    
    a = i
    b = i
    c = i
    if (a + b) % K == 0:
        count += 1
        count += len(minus) * (3*2)
        if len(minus) >= 2:
            kumiawase = math.factorial(len(minus))/(math.factorial(len(minus)-2)*math.factorial(2))
            count += kumiawase * (3*2)
    if i % K == 0:
        minus.append(i)

print(int(count))

Fixed submission:
#import math
N,K = (int(i) for i in input().split())

count = 0
minus = []
for i in range(1,N+1):
    
    a = i
    b = i
    c = i
    if (a + b) % K == 0:
        count += 1
        count += len(minus) * (3*2)
        if len(minus) >= 2:
            #kumiawase = math.factorial(len(minus))/(math.factorial(len(minus)-2)*math.factorial(2))
            kazu = len(minus)
            kumiawase = kazu * (kazu - 1) / 2
            count += kumiawase * (3*2)
    if i % K == 0:
        minus.append(i)

print(int(count))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
nums = []
total = 0
for i in range(N):
    A[i] = A[i] - (i+1)
    if A[i] not in nums:
        nums.append(A[i])
    total = total + A[i]

avg = (total/N)

'''
up = 0
down = 0
for i in range(N):
    if avg >= A[i]:
        down = down + 1
    else:
        up = up + 1


if down > up:
    if avg < 0:
        avg = int(avg) - 1
    else:
        avg = int(avg)
else:
    avg = round(avg)



sad = 0
for i in range(N):
    sad = sad + abs(A[i]-avg)
'''

l = [int(avg)-1,int(avg),int(avg) + 1]
sad = []
for i in range(3):
    tmp = 0
    for j in range(N):
        tmp = tmp + abs(A[j]-l[i])
    sad.append(tmp)

for i in range(len(nums)):
    tmp = 0
    for j in range(N):
        tmp = tmp + abs(A[j]-nums[i])
    sad.append(tmp)
    
print(min(sad))

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

for i in range(N):
    A[i] = A[i] - (i+1)

A.sort()

medium = A[int(N/2)]

s = 0
for i in range(N):
    s = s + abs(A[i]-medium)

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = (int(i) for i in input().split())

for i in range(K):
    tmpA = A
    tmpB = B
    A = B+C
    B = C+tmpA
    C = tmpA + tmpB

ans = A-B
if ans>10**8:
    print("Unfair")
else:
    print(ans)

Fixed submission:
A,B,C,K = (int(i) for i in input().split())


if K%2 == 0:
    ans = A-B
else:
    ans = B-A

if ans>10**18:
    print("Unfair")
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
import math

X =input()

if X == 1:
    output = 1
    print(output)
else:
    mylist = [1]
    biggest = int(math.sqrt(X))
    for i in range(2,biggest):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
        mylist[i] = bekijo
        #print(mylist[i])
    print(max(mylist))

Fixed submission:
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    for i in range(2,X+1):
        bekijo = i
        count = 0
        while bekijo <= X:
            bekijo = bekijo * i
            count = count +1
        if count > 1:
            mylist.append(int(bekijo/i))
    print(max(mylist))

Buggy python submission (verdict: Runtime Error):
import math
X =input()
print(X)
if X == 1:
    output = 1
    print(output)
else:
    mylist = [1]
    biggest = int(math.sqrt(X))
    for i in range(2,biggest):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
            mylist[i] = bekijo
        #print(mylist[i])
    print(max(mylist))

Fixed submission:
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    for i in range(2,X+1):
        bekijo = i
        count = 0
        while bekijo <= X:
            bekijo = bekijo * i
            count = count +1
        if count > 1:
            mylist.append(int(bekijo/i))
    print(max(mylist))
Buggy python submission (verdict: Runtime Error):
H,W = (int(i) for i in input().split())

goal = []
for i in range(H):
    goal.append(input())

canComplete = True

for row in range(W):
    for column in range(H):
        above = row - 1
        bottom = row + 1
        left = column - 1
        right = column + 1
        
        if goal[row][column] == "#":
            if above >= 0 and goal[above][column] == "#":
                continue
            elif bottom < H and goal[bottom][column] == "#":
                continue
            elif left >= 0 and goal[row][left] == "#":
                continue
            elif right < W and goal[row][right] == "#":
                continue
            else:
                canComplete = False
                break

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

Fixed submission:
H,W = (int(i) for i in input().split())

goal = []
for i in range(H):
    goal.append(input())

canComplete = True

for row in range(H):
    for column in range(W):
        above = row - 1
        bottom = row + 1
        left = column - 1
        right = column + 1
        
        if goal[row][column] == "#":
            if above >= 0 and goal[above][column] == "#":
                continue
            elif bottom < H and goal[bottom][column] == "#":
                continue
            elif left >= 0 and goal[row][left] == "#":
                continue
            elif right < W and goal[row][right] == "#":
                continue
            else:
                canComplete = False
                break

if canComplete:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,H = (int(i) for i in input().split())
a = []
b = [0]
for i in range(N):
    A,B = (int(i) for i in input().split())
    a.append(A)
    b.append(B)
    

count = 0
biga = max(a)
bigb = max(b)
b.sort(reverse = True)
while H > 0:
    if bigb > biga:
        H -= bigb
        b.remove(bigb)
        bigb = b[0]
    else:
        H -= biga
    count += 1

print(count)

Fixed submission:
N,H = (int(i) for i in input().split())
a = []
b = [0]
for i in range(N):
    A,B = (int(i) for i in input().split())
    a.append(A)
    b.append(B)
    

count = 0
biga = max(a)
bigb = max(b)
b.sort(reverse = True)

while H > 0:
    if bigb > biga:
        count += 1
        H -= bigb
        b.remove(bigb)
        bigb = b[0]        
    else:
        count += H//biga
        H -= (H//biga)*(biga)
        if H != 0:
            count += 1
        break
        

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N,H = (int(i) for i in input().split())
a = []
b = [0]
for i in range(N):
    A,B = (int(i) for i in input().split())
    a.append(A)
    b.append(B)
    

count = 0
while H > 0:
    bigb = max(b)
    if bigb > max(a):
        H -= bigb
        b.remove(bigb)
    else:
        H -= max(a)
    count += 1

print(count)

Fixed submission:
N,H = (int(i) for i in input().split())
a = []
b = [0]
for i in range(N):
    A,B = (int(i) for i in input().split())
    a.append(A)
    b.append(B)
    

count = 0
biga = max(a)
bigb = max(b)
b.sort(reverse = True)

while H > 0:
    if bigb > biga:
        count += 1
        H -= bigb
        b.remove(bigb)
        bigb = b[0]        
    else:
        count += H//biga
        H -= (H//biga)*(biga)
        if H != 0:
            count += 1
        break
        

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

N = int(input())
a = [int(i) for i in input().split()]

a.sort()
pullout = 0
#print(a)

for i in range(1,max(a)+1):
    numi = bisect.bisect_right(a,i) - bisect.bisect_left(a,i)
    #print(i,numi)
    if numi == 0 or numi == i:
        continue
    elif numi > i:
        pullout += numi - i
    elif numi < i:
        pullout += numi

print(pullout)

Fixed submission:
import bisect

N = int(input())
a = [int(i) for i in input().split()]

a.sort()
pullout = 0
#print(a)

for i in list(set(a)):
    numi = bisect.bisect_right(a,i) - bisect.bisect_left(a,i)
    #print(i,numi)
    if numi == 0 or numi == i:
        continue
    elif numi > i:
        pullout += numi - i
    elif numi < i:
        pullout += numi

print(pullout)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]

a.sort()
for i in range(N):
    if 

Fixed submission:
import bisect

N = int(input())
a = [int(i) for i in input().split()]

a.sort()
pullout = 0
#print(a)

for i in list(set(a)):
    numi = bisect.bisect_right(a,i) - bisect.bisect_left(a,i)
    #print(i,numi)
    if numi == 0 or numi == i:
        continue
    elif numi > i:
        pullout += numi - i
    elif numi < i:
        pullout += numi

print(pullout)
Buggy python submission (verdict: Runtime Error):
Nchar = input()
length = len(Nchar)

N = int(Nchar)
tmp = N
fx = 0
for i in range(length):
    kazu = int(tmp*(0.1**(length-i)))
    fx = fx + kazu
    tmp = tmp - kazu

if(N%fx == 0):
    print("Yes")
else:
    print("No")

Fixed submission:
N = input()

fx = 0
length = len(N)
for i in range(length):
    fx = fx + int(N[i])

if int(N)%fx == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def biggerthanB(x,C):
    for i in range(len(C)):
        if x < C[i]:
            return len(C) - i 
    return 0

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort()
B.sort()
C.sort()

numpattern = 0
for a in range(N):
    for b in range(N):
        if B[b] > A[a]:
            numpattern += biggerthanB(B[b],C)
            #print(A[a],B[b],numpattern)

print(numpattern)

Fixed submission:
import bisect

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort()
B.sort()
C.sort()

numpattern = 0

for i in range(N):
    numsmallerA = bisect.bisect_left(A,B[i])
    numbiggerC = N - bisect.bisect_right(C,B[i])
    numpattern += numsmallerA * numbiggerC

print(numpattern)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = []
numbers = {}
for i in range(N):
    num = int(input())
    if num not in A:
        A.append(num)
        
    if num in numbers.keys():
        numbers[num] = (numbers[num] + 1)%2 
    else:
        numbers[num] = 1

##print(numbers)

count = 0
for i in range(len(A)):
    val = numbers[A[i]]
    if val == 1:
        count += 1

print(count)     

Fixed submission:
N = int(input())

A = []
for i in range(N):
    A.append(int(input()))

A.sort()


tmpcount = 1
count = 0
A.append(-1)

for i in range(1,N+1):
    if A[i] == A[i-1]:
        tmpcount += 1
    else:
        if tmpcount % 2 == 1:
            count += 1
        tmpcount = 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

num = []

for i in range(N):
    A = int(input())
    if A in num:
        num.remove(A)
    else:
        num.append(A)

print(len(num))

Fixed submission:
N = int(input())

A = []
for i in range(N):
    A.append(int(input()))

A.sort()


tmpcount = 1
count = 0
A.append(-1)

for i in range(1,N+1):
    if A[i] == A[i-1]:
        tmpcount += 1
    else:
        if tmpcount % 2 == 1:
            count += 1
        tmpcount = 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
numbers = [int(i) for i in input().split()]

biggest = 1
for i in range(min(numbers),max(numbers)+1):
    count = numbers.count(i-1) + numbers.count(i) + numbers.count(i+1)
    if biggest <= count:
        biggest = count
print(biggest)    
    

Fixed submission:
import collections
N = int(input())
numbers = [int(i) for i in input().split()]
count = collections.Counter(numbers)
biggest = 1
for i in count:
    counting = count[i-1] + count[i] + count[i+1]
    if  counting > biggest:
        biggest = counting

print(biggest)
Buggy python submission (verdict: Runtime Error):
def euclid(A,B):

    big = max(A,B)
    small = min(A,B)

    r = big % small
    while r != 0:
        big = small
        small = r
        r = big % small
    
    return small


def LCM(A,B):
    return int(A*B/euclid(A,B))
    

N = int(input())

time = 1
for i in range(N):
    T = int(input())
    time = LCM(time,T)

print(time)

Fixed submission:
def euclid(A,B):

    big = max(A,B)
    small = min(A,B)

    r = big % small
    while r != 0:
        big = small
        small = r
        r = big % small
    
    return small


def LCM(A,B):
    return A*B//euclid(A,B)
    

N = int(input())

time = 1
for i in range(N):
    T = int(input())
    time = LCM(time,T)

print(time)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

T.sort(reverse = True)

def GCD(a,b):
    if a>=b:
        bigger = a
        smaller = b
    else:
        smaller = a
        bigger = b
        
    if smaller == 0:
        return bigger
    else:
        return GCD(smaller, bigger%smaller)

def GCF(a,b):
    return int((a*b)/GCD(a,b))

if N == 1:
    print(T[0])
elif N == 2:
    print(GCF(T[0],T[1]))
else:
    tmp = GCF(T[0],T[1])
    for i in range(2,N):
        tmp = GCF(tmp,T[i])
    print(tmp)

Fixed submission:
def euclid(A,B):

    big = max(A,B)
    small = min(A,B)

    r = big % small
    while r != 0:
        big = small
        small = r
        r = big % small
    
    return small


def LCM(A,B):
    return A*B//euclid(A,B)
    

N = int(input())

time = 1
for i in range(N):
    T = int(input())
    time = LCM(time,T)

print(time)
Buggy python submission (verdict: Runtime Error):
O = input()
E = input()

password = ""
for i in range(len(E)):
    password = password + O[i] + E[i]

if len(E)%2 == 1:
    print(password)
else:
    password = password + O[len(O)]
    print(password)

Fixed submission:
O = input()
E = input()

olen = len(O)
elen = len(E)

word = ""

if olen==elen:
    for i in range(olen):
        word = word + O[i] + E[i]
else:
    for i in range(elen):
        word = word + O[i] + E[i]
    word = word + O[olen-1]

print(word)

Buggy python submission (verdict: Runtime Error):
O = input()
E = input()

password = ""
for i in range(len(E)):
    password = password + O[i] + E[i]

if len(E)%2 == 1:
    print(password)
else:
    password = password + O[len(O)]
    print(password)

Fixed submission:
O = input()
E = input()

olen = len(O)
elen = len(E)

word = ""

if olen==elen:
    for i in range(olen):
        word = word + O[i] + E[i]
else:
    for i in range(elen):
        word = word + O[i] + E[i]
    word = word + O[olen-1]

print(word)
Buggy python submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())

student = []
for i in range(N):
    a,b = (int(k) for k in input().split())
    student.append([a,b])

points = []
for i in range(M):
    c,d = (int(k) for k in input().split())
    points.append([a,b])
    
distance = []
kyori = []


for i in range(N):
    for j in range(1):
        kyori.append(abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1]))
    distance.append(min(kyori[j]))

for i in range(N):
    for j in range(1,M):
        kyori[j] = abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1])
    distance.append(min(kyori[j]))

for i in range(N):
    print(distance[i])

Fixed submission:
N,M = (int(i) for i in input().split())
a=[]
b=[]
c=[]
d=[]

for i in range(N):
    A,B = (int(i) for i in input().split())
    a.append(A)
    b.append(B)

for i in range(M):
    C,D = (int(i) for i in input().split())
    c.append(C)
    d.append(D)


closest = N*[0]

for i in range(N):
    minimum = abs(a[i]-c[0])+abs(b[i]-d[0])
    number = 1
    for j in range(1,M):
        distance = abs(a[i]-c[j])+abs(b[i]-d[j])
        if distance < minimum:
            minimum = distance
            number = j+1
    closest[i] = number

for i in range(N):
    print(closest[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

power = 1
for i in range(N):
    power = power*(i+1)

print(power%(10**9+7))


Fixed submission:
N = int(input())

power = 1
for i in range(N):
    power = power*(i+1)
    if power >= 10**5:
        power = power%(10**9+7)

print(power%(10**9+7))
Buggy python submission (verdict: Runtime Error):
N = int(input())

t = input().split()
T = []
for i in range(N):
    T.append(int(t[i]))

M = int(input())

time = []
total = sum(T)
for k in range(M):
    p,x = (int(i) for i in input().split())
    time.append（total - T[p] + x)

print(time)

Fixed submission:
N = int(input())

t = input().split()
T = []
for i in range(N):
    T.append(int(t[i]))

M = int(input())

time = []
total = sum(T)
for k in range(M):
    p,x = (int(i) for i in input().split())
    time.append(total - T[p-1] + x)

for i in range(M):
    print(time[i])

Buggy python submission (verdict: Runtime Error):
N = int(input())

t = input().split()
T = []
for i in range(N):
    T.append(int(t[i]))

M = int(input())

time = []
total = sum(T)
for i in range(M):
    p,x = (int(i) for i in input().split())
    time.append（total - T[p] + x)

print(time)

Fixed submission:
N = int(input())

t = input().split()
T = []
for i in range(N):
    T.append(int(t[i]))

M = int(input())

time = []
total = sum(T)
for k in range(M):
    p,x = (int(i) for i in input().split())
    time.append(total - T[p-1] + x)

for i in range(M):
    print(time[i])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = (int(i) for i in input().split())

count = 0
for i in range(a,b+1):
    if i%x==0:
        count = count+1

print(count)

Fixed submission:
a,b,x = (int(i) for i in input().split())

ika = (a-1)//x
zenbu = b//x

print(zenbu - ika)
Buggy python submission (verdict: Runtime Error):
SA = input()
SB = input()
SC = input()

A = []
for i in range(len(SA)):
    tmp = SA[i]
    A.append(tmp)

B = []
for i in range(len(SB)):
    tmp = SB[i]
    B.append(tmp)

C = []
for i in range(len(SC)):
    tmp = SC[i]
    C.append(tmp)

suteru = A[0]
A.remove(A[0])

lenA = len(A)

have = True
while have:
    if suteru == "a":
        suteru = A[0]
        A.remove(A[0])
        if len(A) == 0:
            moji = "A"
            have = False
    elif suteru == "b":
        suteru = B[0]
        B.remove(B[0])
        if len(B) == 0:
            moji = "B"
            have = False
    elif suteru == "c":
        suteru == C[0]
        C.remove(C[0])
        if len(C) == 0:
            moji = "C"
            have = False

if lenA == 1:
    print("A")
else:
    print(moji)
    

Fixed submission:
A = input()
B = input()
C = input()

throw = "a"
a = 0
b = 0
c = 0

while True:
    if throw == "a":
        if a == len(A):
            print("A")
            break       
        throw = A[a]
        a += 1
    elif throw == "b":
        if b == len(B):
            print("B")
            break
        throw = B[b]
        b += 1
    elif throw == "c":
        if c == len(C):
            print("C")
            break
        throw = C[c]
        c += 1

Buggy python submission (verdict: Time Limit Exceeded):
A = input()
B = input()
C = input()

moji = A[0]
while(len(A)!=0 or len(B)!=0 or len(C)!=0):
    if moji == "a":
        A = A[2:]
        print(A)

Fixed submission:
A = input()
B = input()
C = input()

throw = "a"
a = 0
b = 0
c = 0

while True:
    if throw == "a":
        if a == len(A):
            print("A")
            break       
        throw = A[a]
        a += 1
    elif throw == "b":
        if b == len(B):
            print("B")
            break
        throw = B[b]
        b += 1
    elif throw == "c":
        if c == len(C):
            print("C")
            break
        throw = C[c]
        c += 1
Buggy python submission (verdict: Runtime Error):
A,B,C = (int(i) for i in input().split())

Aaddition = A+B+C
if Addition != 17:
  haiku = False
else:
  if ((A==5 or A==7) and (B==5 or B==7) and (C==5 or C==7)):
    haiku = True
  else:
    haiku = False
    
if haiku:
  print("YES")
else:
  print("NO")


Fixed submission:
A,B,C = (int(i) for i in input().split())

Addition = A+B+C
if Addition != 17:
    haiku = False
else:
    if ((A==5 or A==7) and (B==5 or B==7) and (C==5 or C==7)):
        haiku = True
    else:
        haiku = False
    
if haiku:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
A,B,C = (int(i) for i in input().split())

Aaddition = A+B+C
if Addition != 17:
  haiku = False
else:
  if((A==5 or A==7) and (B==5 or B==7) and (C==5 or C==7) ):
    haiku = True
  else:
    haiku = False
    
if haiku:
  print("YES")
else:
  print("NO")

Fixed submission:
A,B,C = (int(i) for i in input().split())

Addition = A+B+C
if Addition != 17:
    haiku = False
else:
    if ((A==5 or A==7) and (B==5 or B==7) and (C==5 or C==7)):
        haiku = True
    else:
        haiku = False
    
if haiku:
    print("YES")
else:
    print("NO")