Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def make_divisors(n: int) -> list:
    divisors = []

    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    return divisors


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

ans = []
for i in reversed(range(N)):
    if A[i] == 1:
        ans.append(i + 1)
        divisors = make_divisors(i + 1)
        for j in divisors:
            A[j + 1] = (A[j + 1] + 1) % 2

if A.count(1) != 0:
    print(len(ans))
    for i in reversed(range(len(ans))):
        print(ans[i])
else:
    print(-1)


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

ans = []
for i in reversed(range(1, N + 1)):
    if sum(A[i::i]) % 2 != A[i]:
        A[i] = (A[i] + 1) % 2
    if A[i] == 1:
        ans.append(i)

print(len(ans))
if len(ans) > 0:
    print(*ans)

Buggy python submission (verdict: Runtime Error):
def make_divisors(n: int) -> list:
    divisors = []

    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    return divisors


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

ans = []
for i in reversed(range(N)):
    if A[i] == 1:
        ans.append(i + 1)
        divisors = make_divisors(i + 1)
        for j in divisors:
            A[j + 1] = (A[j + 1] + 1) % 2

print(len(ans))
for i in reversed(range(len(ans))):
    print(ans[i])


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

ans = []
for i in reversed(range(1, N + 1)):
    if sum(A[i::i]) % 2 != A[i]:
        A[i] = (A[i] + 1) % 2
    if A[i] == 1:
        ans.append(i)

print(len(ans))
if len(ans) > 0:
    print(*ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
SP = [(i + 1, input().split()) for i in range(N)]
P = [[0, 0, 0] for _ in range(N)]
for i in range(N):
    P[i][0] = SP[i][0]
    P[i][1] = SP[i][1][0]
    P[i][2] = int(SP[i][1][1])
P.sort(key=lambda x: x[1][1], reverse=True)
P.sort(key=lambda x: x[1][0])

for p in P:
    print(p[0])


Fixed submission:
N = int(input())
SP = [(i + 1, input().split()) for i in range(N)]
P = [[0, 0, 0] for _ in range(N)]
for i in range(N):
    P[i][0] = SP[i][0]
    P[i][1] = SP[i][1][0]
    P[i][2] = int(SP[i][1][1])
P.sort(key=lambda x: x[2], reverse=True)
P.sort(key=lambda x: x[1])

for p in P:
    print(p[0])
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

id_list = [0] * N

for _ in range(M):
    L, R = map(int, input().split())
    for i in range(L, R + 1):
        id_list[i - 1] += 1

print(sorted(id_list, reverse=True).count(M))


Fixed submission:
N, M = map(int, input().split())

L, R = 1, N
for _ in range(M):
    Li, Ri = map(int, input().split())
    if L <= Li:
        L = Li
    if Ri <= R:
        R = Ri

print(R - L + 1 if (R >= L) else 0)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

id_list = []
for i in range(1, N + 1):
    id_list.append(i)

for _ in range(M):
    L, R = map(int, input().split())
    tmp = []
    for i in range(L, R + 1):
        tmp.append(i)
    id_list = list(set(id_list) & set(tmp))

print(len(id_list))


Fixed submission:
N, M = map(int, input().split())

L, R = 1, N
for _ in range(M):
    Li, Ri = map(int, input().split())
    if L <= Li:
        L = Li
    if Ri <= R:
        R = Ri

print(R - L + 1 if (R >= L) else 0)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

ans = 0
for i in range(N // R + 1):
    N_R = N - i * R
    for j in range(N_R // G + 1):
        N_RG = N_R - j * G
        for k in range(N_RG // B + 1):
            N_RGB = N_RG - k * B
            if N_RGB == 0:
                ans += 1
print(ans)


Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(N // R + 1):
    for j in range((N - i * R) // G + 1):
        if (N - i * R - j * G) % B == 0:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
H, W = int(input().split())
h, w = int(input().split())

print((H - h) * (W - w))
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H - h) * (W - w))


Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H - h) * (W - w))

Buggy python submission (verdict: Runtime Error):
H, W = int(input().split())
h, w = int(input().split())

print((H - h) * (W - w))


Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

print((H - h) * (W - w))
Buggy python submission (verdict: Runtime Error):
K = int(input())

if K % 2:
    print((K // 2) * (K // 2 + 1))
else:
    print((K // 2)**2)


Fixed submission:
A, B, C = map(int, input().split())

if C <= B / A:
    print(C)
else:
    print(int(B / A))
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input())

print(X + int(Y / 2))

Fixed submission:
X, Y = map(int, input().split())

print(X + int(Y / 2))
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N == 1:
    print("Hello World")
else:
    A, B = map(int, input().split())
    print(A + B)


Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A + B)

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

if N == 1:
    print("Hello World")
else:
    A, B = map(int, input().split())
    print(A + B)


Fixed submission:
N = int(input())

if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A + B)
Buggy python submission (verdict: Runtime Error):
A = [map(int, input().split())]

print(max(A) - min(A))


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

print(max(A) - min(A))
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
print(a if a <= b else a - 1)


Fixed submission:
a, b = map(int, input().split())
print(a if a <= b else a - 1)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
import math
i = 0
l = list(range(K+1))[1:]

for a in l:
    for b in l:
        for c in l:
            i += math.gcd(math.gcd(a,b), c)
print(i)


Fixed submission:
K = int(input())
import math
i = 0
l = list(range(K+1))[1:]

for a in l:
    for b in l:
        for c in l:
            i += math.gcd(math.gcd(a,b), c)
print(i)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
print(max(0, A - K), max(0, min(A + B -K, B)))

Fixed submission:
S, T = input().split()
print(T+S)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
print(max(0, A - K), max(0, min(A + B -K, B))

Fixed submission:
A, B, K = map(int, input().split())
print(A - K, B) if A > K else print(0, A + B -K) if A + B > K else print(0, 0)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = list(map(int, input().split()))
count = 0
for h in H:
    if h >= K:
        count += 1
print(count)


Fixed submission:
N = int(input())
print(0.5 if N % 2 == 0 else -(-N // 2)/ N)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
lst = list(map(int, input().split()))
i = 0
for h_i in lst:
    if h_i < K:
        continue
    else:
        i += 1
print(i)

Fixed submission:
N = int(input())
print(0.5 if N % 2 == 0 else -(-N // 2)/ N)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
lst = list(map(int, input().split()))
i = 0
for h_i in lst:
    if h_i < K:
        continue
    i += 1
print(i)

Fixed submission:
N = int(input())
print(0.5 if N % 2 == 0 else -(-N // 2)/ N)

Buggy python submission (verdict: Runtime Error):
N = int(input())
print(0.5 if N % 2 == 0 else ((N //2) + !)/ 2)

Fixed submission:
N = int(input())
print(0.5 if N % 2 == 0 else -(-N // 2)/ N)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
lst = [map(int, input().split())]
i = 0
for h_i in lst:
    if h_i < K:
        continue
    i += 1
print(i)

Fixed submission:
N, K = map(int, input().split())
lst = list(map(int, input().split()))
i = 0
for h_i in lst:
    if h_i < K:
        continue
    else:
        i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
i = 1
for j in range(3):
    if S[j] == T[J]:
        i += 1
print(i)


Fixed submission:
S = input()
T = input()
i = 0
for j in range(3):
    if S[j] == T[j]:
        i += 1
print(i)

Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
i = 1
for j in range(3):
    if S[j] = T[J]:
        i += 1
print(i)


Fixed submission:
S = input()
T = input()
i = 0
for j in range(3):
    if S[j] == T[j]:
        i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split()) 
h, w = map(int, input(.split()))
print((H-h) * (W - w))


Fixed submission:
H, W = map(int, input().split()) 
h, w = map(int, input().split())
print((H-h) * (W - w))
Buggy python submission (verdict: Runtime Error):
S = input()
print('Heisei' if S[5, 7] < '04' or (S[6] == 4 and S[8,] < '31') else 'TBD')

Fixed submission:
S = input()
print('Heisei' if S[5:7] < '04' or (S[6] == '4' and S[8:] < '31') else 'TBD')
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(int, input().split())
print('Yes' if max(l) < sum(l) - max(l) else 'No')

Fixed submission:
N = int(input())
l = list(map(int, input().split()))
print('Yes' if max(l) < sum(l) - max(l) else 'No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [int(input()) for i in range(N)]
print('Yes' if max(l) < sum(l) - max(l) else 'No')

Fixed submission:
N = int(input())
l = list(map(int, input().split()))
print('Yes' if max(l) < sum(l) - max(l) else 'No')
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input())
print(X+(Y/2))

Fixed submission:
X, Y = map(int, input().split())
print(X+(Y//2))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
print((A+B)%24)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))

if a[0] * b[1] % 2 == 0:
    print('Even')

else:
    print('Odd')
    

Fixed submission:
a = list(map(int, input().split()))

if a[0] * a[1] % 2 == 0:
    print('Even')

else:
    print('Odd')

Buggy python submission (verdict: Runtime Error):
a = map(int, input().split())

if a[0] * b[1] % 2 == 0:
    print('Even')

else:
    print('Odd')

Fixed submission:
a = list(map(int, input().split()))

if a[0] * a[1] % 2 == 0:
    print('Even')

else:
    print('Odd')

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

if a * b % 2 == 0:
    print('Even')

else:
    print('Odd')

Fixed submission:
a = list(map(int, input().split()))

if a[0] * a[1] % 2 == 0:
    print('Even')

else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
print('Left' if (A + B) > C + D else 'Balanced' if (A + B) = (C + D) else 'Right')

Fixed submission:
A, B, C, D = map(int, input().split())
print('Left' if (A + B) > C + D else 'Balanced' if (A + B) == (C + D) else 'Right')

Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
print('Left' if A + B > C + D else 'Balanced' if A + B = C + D else 'Right')

Fixed submission:
A, B, C, D = map(int, input().split())
print('Left' if (A + B) > C + D else 'Balanced' if (A + B) == (C + D) else 'Right')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input())
print((n - 1) * (m - 1))

Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))
Buggy python submission (verdict: Runtime Error):
A, B, C = input().split()
print('YES'  if A[-1] == B[0] and B[-1] == C[0])

Fixed submission:
A, B, C = input().split()
print('YES'  if A[-1] == B[0] and B[-1] == C[0] else 'NO')
Buggy python submission (verdict: Runtime Error):
N = int(input())
import math
N! = math.factorial(N)
print(N!)

Fixed submission:
N = int(input())
import math
N = math.factorial(N)
print(N % (10**9+7))
Buggy python submission (verdict: Runtime Error):
a, b, c = input().split(,)
print(a, b, c)

Fixed submission:
a, b, c = input().split(',')
print(a, b, c)
Buggy python submission (verdict: Runtime Error):
lst = list(map(int, input().split()))
lst = lst.sorted()
print('Yes' if lst[0] + lst[1] == lst[2] else 'No')

Fixed submission:
lst = list(map(int, input().split()))
lst = sorted(lst)
print('Yes' if lst[0] + lst[1] == lst[2] else 'No')

Buggy python submission (verdict: Runtime Error):
lst = [map(int, input().split())]
lst = lst.sorted()
print('Yes' if lst[0] + lst[1] == lst[2] else 'No')

Fixed submission:
lst = list(map(int, input().split()))
lst = sorted(lst)
print('Yes' if lst[0] + lst[1] == lst[2] else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
#x,y,z = list(map(int,input().split()))
# k = int(input())

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for kk in range(1,k+1):
            ans += gcd(i,j,kk)


print(ans)


Fixed submission:
#x,y,z = list(map(int,input().split()))
# k = int(input())

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for kk in range(1,k+1):
            ans += gcd(i,j,kk)


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#x,y,z = list(map(int,input().split()))
# k = int(input())

import numpy as np

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for kk in range(1,k+1):
            if i == j == kk:
                ans += i
                continue
            ans += np.gcd(np.gcd(i,j),kk)            

print(ans)


Fixed submission:
#x,y,z = list(map(int,input().split()))
# k = int(input())

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for kk in range(1,k+1):
            ans += gcd(i,j,kk)


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
a= list(map(int,input().split()))
c = collections.Counter(a)

for i in range(len(a)):
    ans = 0
    for item, value in c.items():
        if item == a[i]:
            value -= 1
        ans += value * (value-1) // 2

    print(ans)


Fixed submission:
import collections

n = int(input())
a= list(map(int,input().split()))
c = collections.Counter(a)

mx = 0

for item, value in c.items():
    mx += value * (value-1) // 2

for i in range(len(a)):
    ans = mx

    t = c[a[i]]
    ans -= t * (t-1) //2
    ans += (t-1)*(t-2) //2
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
a= list(map(int,input().split()))
c = collections.Counter(a)

for i in range(len(a)):
    t = a[:i] + a[i+1:]
    ans = 0
    c = collections.Counter(t)
    for j in c.values():
        ans += j * (j-1) // 2

    print(ans)


Fixed submission:
import collections

n = int(input())
a= list(map(int,input().split()))
c = collections.Counter(a)

mx = 0

for item, value in c.items():
    mx += value * (value-1) // 2

for i in range(len(a)):
    ans = mx

    t = c[a[i]]
    ans -= t * (t-1) //2
    ans += (t-1)*(t-2) //2
    print(ans)
Buggy python submission (verdict: Runtime Error):
    #n,m = list(map(int,input().split()))
    s = input()
     
    if s[0] == s[1] == s[2]:
      print('No')
    else:
      print('Yes')

Fixed submission:
#n,m = list(map(int,input().split()))
s = input()

if s[0] == s[1] == s[2]:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import math
from operator import mul
from functools import reduce

def cmb(n,r, mod):
  r = min(n-r,r)
  if r == 0: return 1
  over = reduce(mul, range(n, n - r, -1))
  under = reduce(mul, range(1,r + 1))
  return (over // under) %mod

def cmb2(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


n, a, b = list(map(int, input().split()))
mod = 10**9+7

#print((pow(2, n, 1000000000+7) - combinations_count(n, a) - 1 - combinations_count(n, b))%(1000000000+7))
print((pow(2, n, mod) - cmb(n, a, mod) - 1 - cmb(n, b, mod)))


Fixed submission:
n, a, b = list(map(int, input().split()))
mod = 10**9 + 7

def choose(n, a):
    x = 1
    y = 1
    for i in range(1, a + 1):
        x = (x * (n - i + 1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod - 2, mod)) % mod

print((pow(2, n, mod) - 1 - choose(n, a) - choose(n, b)) % mod )
Buggy python submission (verdict: Time Limit Exceeded):
import math
n, k = list(map(int, input().split()))

mod = 10**9 + 7

def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod

ans = 0
for i in range(min(k+1,n+1)):
    ans = (ans + (choose(n, i) * choose(n-1, i)) % mod) % mod
print(ans)


Fixed submission:
n, k = list(map(int, input().split()))

mod = 10**9 + 7
k = min(k, n-1)

def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod

kaijo = [1]
for i in range(1,n+1): 
  kaijo.append(kaijo[i-1]*i % mod)

ans = 0
for i in range(k+1):
#    ans += (choose(n, min(i,n-i)) * choose(n-1, min(i,n-1-i))) % mod
    ans += kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) * kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod)
    ans = ans % mod
print(ans % mod)
Buggy python submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
p = [input().split() for i in range(m)]

s = {i + 1 for i in range(n)}

ac = 0
wa = {i + 1:[0, False] for i in range(n)}


for i in range(m):
  if int(p[i][0]) in s:
    if p[i][1] == 'WA':
      wa[int(p[i][0])][0] += 1
    else:
      ac += 1
      s.discard(int(p[i][0]))
      wa[int(p[i][0])][1] = True
      
wa_wa = 0
for i in range(1, n + 1):
  if wa[i][1]:
    wa_wa += wa[i][0]
print(ac, wa_wa)
n, m = list(map(int, input().split()))
p = [input().split() for i in range(m)]

s = {i + 1 for i in range(n)}

ac = 0
wa = {i + 1:[0, False] for i in range(n)}


for i in range(m):
  if int(p[i][0]) in s:
    if p[i][1] == 'WA':
      wa[int(p[i][0])][0] += 1
    else:
      ac += 1
      s.discard(int(p[i][0]))
      wa[int(p[i][0])][1] = True
      
wa_wa = 0
for i in range(1, n + 1):
  if wa[i][1]:
    wa_wa += wa[i][0]
print(ac, wa_wa)


Fixed submission:
n, m = list(map(int, input().split()))
p = [input().split() for i in range(m)]

s = {i + 1 for i in range(n)}

ac = 0
wa = {i + 1:[0, False] for i in range(n)}


for i in range(m):
  if int(p[i][0]) in s:
    if p[i][1] == 'WA':
      wa[int(p[i][0])][0] += 1
    else:
      ac += 1
      s.discard(int(p[i][0]))
      wa[int(p[i][0])][1] = True
      
wa_wa = 0
for i in range(1, n + 1):
  if wa[i][1]:
    wa_wa += wa[i][0]
print(ac, wa_wa)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = n * (10**4)
c = [inf] * n

c[0] = 0
c[1] = abs(h[1]-h[0]) + c[0]

for i in range(2,n):
    for j in range(1, k + 1):
        if i - j < 0:
            continue
        if c[i] < c[i-j]:
            continue
        c[i] = min(c[i], abs(h[i] - h[i-j]) + c[i-j])

print(c[n-1])


Fixed submission:
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = n * (10**4)
c = [inf] * n

c[0] = 0
c[1] = abs(h[1]-h[0]) + c[0]

for i in range(2,n):
    for j in range(1, k + 1):
        if i - j < 0:
            continue
        if c[i] < c[i-j]:
            continue
        c[i] = min(c[i], abs(h[i] - h[i-j]) + c[i-j])

print(c[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = n * (10**4)
c = [inf] * n

c[0] = 0
c[1] = abs(h[1]-h[0]) + c[0]

for i in range(2,n):
    for j in range(1, k + 1):
        if i - j < 0:
            continue
        c[i] = min(c[i], abs(h[i] - h[i-j]) + c[i-j])

print(c[n-1])


Fixed submission:
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))

inf = n * (10**4)
c = [inf] * n

c[0] = 0
c[1] = abs(h[1]-h[0]) + c[0]

for i in range(2,n):
    for j in range(1, k + 1):
        if i - j < 0:
            continue
        if c[i] < c[i-j]:
            continue
        c[i] = min(c[i], abs(h[i] - h[i-j]) + c[i-j])

print(c[n-1])
Buggy python submission (verdict: Runtime Error):
n = input()
a = input()

print(n*n-a)

Fixed submission:
n = int(input())
a = int(input())

print(n*n-a)
Buggy python submission (verdict: Runtime Error):
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
# from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

s, = input()
ans = 'No'
if s[2] == s[3] and s[5] == s[6]:
    ans = 'Yes'
print(ans)

Fixed submission:
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
# from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

s = input()
ans = 'No'
if s[2] == s[3] and s[4] == s[5]:
    ans = 'Yes'
print(ans)