peterverebics/CodeNet_Python_118 huggingface dataset:
n, k = input().split(" ")
n = int(n)
k = int(k)
 
remain = n % k
if( k==1):
  print(remain)
elif( remain == 0 ):
  print(remain)
else:
  print( min(abs( remain - k), abs(k-remain) ))
n,k=map(int,input().split())
t = int(n/k)
tt = t + 1
ttt = t - 1
ans=min([n - t*k,tt*k - n,n - ttt*k])
print(str(ans))
import numpy as np
N, K = list(map(int,input().split()))
tmp = np.zeros(2)
tmp[0] = N % K
tmp[1] = abs(tmp[0] - K)

print(int(tmp.min()))
import fractions
n, k = map(int, input().split())

if k == 1 or n == 0 or n == k:
    print('0')
else:
    n = fractions.gcd(n, k)
    while n > abs(n - k):
        n = abs(n - k)
    if n == k:
        n = 0
    print(n)
import sys
N, K = map(int, input().split())
if N == 1 or N == 0 or K ==1:
    print(0)
    sys.exit()

if N > K:
    N = N - K*(N//K)
elif K > N:
    K = K - N*(K//N)

while abs(N-K) < N:
    N = min(abs(N-K), N)
print(N)
n,k=map(int,input().split())
print(min(n%k,n%k-k))
#coding:utf-8
import math
n, k = map(int, input().split())

if n < k:
    print(min(n, abs(n-k)))
elif k == 1 or n == 0 or (k % 2 == 0 and n % 2 == 0):
    print(0)
elif (k % 2 == 0 and n % 2 == 1) or (n % 2 == 0 and k % 2 == 1) or (k % 2 == 1 and n % 2 == 1):
    print(1)
n, k = (int(x) for x in input().split())
i = int(n/k)
f = n/k - i
if f<= 0.5:
  print(abs(n - i*k))
else:
  print(abs(n - (i + 1)*k))
#n = int(input())
n,k = map(int,input().split())
#a_L = list(map(int,input().split()))

if abs(n-k) > n:
    print(n)
    exit()

if n > k:
    tmp = n%k
    print(min(tmp,abs(tmp-k)))
    exit()

if n==k:
    print(0)
    exit()

if n == 0:
    print(0)
N, K= (map(int, input().split()))
if N > K:
    N = N%K
    number_list = [N]
else:
    number_list = [N]

print(min(number_list))
n, k = map(int, input().split())
if n%k == 0:
    print(0)
elif n%2 == 0 and k%2 == 0:
    print(2)
elif n%2 == 1 and k%2 == 1:
    tmp = n % k
    print(min(tmp, k-tmp)) 
else:
    print(1)
N, K = list(map(int, input().split()))

tmp = abs(N % K)

if tmp == 0:
    print(0)
elif N <= tmp:
    print(N)
else:
    print(K - tmp)
n, k = map(int, input().split())

max_i = max(n, k)


if n>=k:
    n = n%k
else:
    for _ in range(max_i):
        tmp = abs(n-k)
        if tmp >= n:
            break
        else :
            n = tmp
    
    print(n)
n,k=list(map(int,input().split()))
x=0
y=0
while n>0:
    x=n-k
    y=x
    n=x
n=n*(-1)
if n==0:
    print(n)
elif y>n:
    print(n)
else:
    print(y)
from sys import stdin
import math

n, k = [int(x) for x in stdin.readline().rstrip().split()]
print(min(abs(n-math.floor(n/k)*k), abs(n-math.ceil(n/k)*k)))
N, K = map(int, input().split())
result = N % K
print(result)
N, K = map(int, input().split(' '))

if abs(N - int(N / K)* K - K) > N:
    print(N)
else:
    print(abs(N - int(N / K)* K - K))
n,k=map(int,input().split())
t=0
N=abs(n-k)
while N<n:
    n=N
    N=abs(n-k)
    t=1
if t==1:
    print(N)
else:
    print(n)
num = list(map(int, input().split()))

loop = [0]

for i in loop:
  if num[0] < num[1]:
    num[0] = abs(num[0] - num[1])
    break
  elif num[1] == 1:
    num[0] = 0
    break
  elif num[1] == 0:
    break
  num[0] = abs(num[0] - num[1])
  loop.append(i+1)

print(num[0])
n, k = map(int, input().split())
L = []
if n > k:
  n = n - k*(n//k)
 
if n*2 <= k:
  print(n)
else:
  print(k)
N,K=map(int,input().split())

N=N%K

print(min(K,abs(N-K)))
import sys
input = sys.stdin.readline
# int(input()) # 入力が1つ
n, k = map(int, input().split()) # 入力が複数

# if k == 1:
#     print(0)
# else:
ans = n % k
print(ans)
n, k = map(int, input().split())

if n==k:
    ans = 0
elif n<k:
    ans = n
else:
    if n%k==0:
        ans=0
    else:
        ans = min(n%k, k-(n%k))

print(ans)
n,k=map(int,input().split())
if n>k:
    num=int(n/k)
    ans=min(n-num*k,abs(n-(num+1)*k))
    print(ans)
else:
    print(min(k-n,n))
a,b=map(int,input().split())
m=a%b
if b<m:
    m=b
print(m)
n, k = map(int, input().split())
a = abs(n - k)
if k == 1:
    print(0)
elif a > n:
    print(n)
else:
    while n > k:
        n = n // k
    print(n % k)
N,K=map(int,input().split())
import math
if K>=N:
  N=min(K-N,N)
else:
  N=N-(math.ceil(N/K-1)*K)
  N=min(abs(K-N),N)
print(N)
from fractions import gcd 
n,k = map(int,input().split())
if k == 1:
    print(0)
    exit()
if n > k and gcd(n,k) == k:
    print(0)
else:
    print(gcd(n,k))
n, k = map(int, input().split())
list = [n]
list.append(abs(n-k))
while(list[-1] >= list[-2]):
	n = abs(n-k)
	list.append(n)

print(min(list))
import math
n, k = map(int, input().split())

aaa = (n % k)

if aaa == 0:
  ret = 0
else:
  if n > k:
    ret = min(abs(aaa - k), aaa)
  else:
    if k % n == 0:
      ret = n
    else:
      ret = k % n

print(ret)
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K or N%K==0:
    print(0)
    exit()
elif K == 0 or K > N:
    print(N)
    exit()
elif N == 1 or N == K-1 or K == N-1 or N%K==1:
    print(1)
    exit()
elif N > K:
    ans = (N//K) + 1
    res = abs(N - (K*ans))
    print(res)
    exit()
n, k = (int(i) for i in input().split())
if k > n:
    print(n, abs(n-k))
elif n % k == 0:
    print(0)
else:
    q = n % k
    p = (k * (n//k+1)) - n
    print(min(p, q))
import sys
N, K = map(int,input().split())

if N < K:
    print(N)
    sys.exit(0)
else:
    ans = N % K
    ans = min(ans, abs(K-ans))
print(ans)
N, K = input().split()
N = int(N)
K = int(K)
if N>K:
    while N>0:
        N=N-K
        if N<=0:
            print(abs(N))
else:
    print(N)
N, K = map(int, input().split())
a = N
while True:
    if K >= a:
        print(abs(K - N))
        break
    else:
        a = abs(K - N)
N,K = map(int,input().split())

t1 = int(N/K)
t2 = t1 + 1
t3 = t1 + 2
t4 = t1 - 1
t5 = t1 - 2
ans1 = abs(N-K*t1)
ans2 = abs(N-K*t2)
ans3 = abs(N-K*t3)
ans4 = abs(N-K*t4)
ans5 = abs(N-K*t5)
print(min([ans1,ans2,ans3,ans4,ans5]))
import sys
N, K = map(int, input().split())
if N == 1 or N == 0 or K == 1 or N == K:
    print(0)
    sys.exit()

if N > K:
    N = N%K
elif K > N:
    K = K%N

ans = [N]
for _ in range(10):
    ans.append(abs(N-K))
    N = abs(N-K)

print(min(ans))
N, K = map(int, input().split())

if N == 0 or K == 1:
    N = 0
elif N == K:
    N = 0
elif N % K == 0:
    N = 0
else:
    N = N % K

print(N)
import itertools
import math
import fractions

n,k = map(int,input().split())
ans = n
if k == 1 or n == 0 or n==k :
    print("0")
    exit()
elif n < k:
    ans = abs(n-k)
    print(min(ans,n))

elif n > k:
    ans = n%k



while(1):
    
    ans = abs(ans-k)
    if ans == n:
        break
    if ans == 1 or 0:
        break
print(ans)
N, K = map(int, input().split())
a = N % K
if N >= K:
    print(min(a, abs(a-K)))
else:
    print(N)
from fractions import gcd
n,k = map(int,input().split())
print(gcd(n,k))
N,K = map(int,input().split())
if N / 2 < K / 2:
    F = N // K + 1
else: 
    F = N // K + 1
r = [
    abs(N),
    abs((N - (K * F)))
]
print(min(r))
import sys


n,k= map(int,input().split())
v={}

min = sys.maxsize

if n == 0 :print(0);exit()

if n > k :
    x = n%k
    if x > k:print(x);exit()
    else:
        n=x
        v[x] = True

while True:
    diff = abs(n- k)

    if v.get(diff):
        break
    else:
        # print(diff)
        v[diff] = True
        n = diff

        if diff < min:
            min = diff



print(min)
N, K = map(int, input().split())

if N % K == 0:
    print(0)
elif abs(N - K) >= N:
    print(N)
else:
    print(1)
N, K = map(int, input().split())

if N > K:
    N = N - K*(N//K)

if N==K:
    print(0)
else:
    print(K-N)
n, k = map(int, input().split())

if n % k == 0 or n == 0:
    print(0)
else:
    while n > n % abs(n - k):
        n = n % abs(n - k)
        if abs(n - k) == 0:
            n = 0
            break
    print(n)
n, k = map(int, input().split())
if n%2==0 and k%2==0:
    print(2)
elif n%2==1 and k%2==0:
    print(1)
elif n%2==0 and k%2==1:
    print(0)
elif n%2==1 and k%2==1:
    print(3)
n,k=map(int,input().split())
ans=0
a=[]
if k==1:
  print(0)
elif abs(n-k) > n:
  print(n)
else:
  while len(a)==len(set(a)):
    n=abs(n-k)
    if n == 1:
      break
    a.append(n)
  print(min(a))
def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 

n, k = [int(x) for x in input().strip().split()]

if n==0:
    res = 0
elif k==0:
    res=n
else:
    res = gcd(n,k)

if n>=k:
    if res==k:
        res=0

print(res)
N, K = map(int, input().split())
if N == K:
    print(0)
    exit()

tmp1 = 0
if N > K:
    tmp, m = divmod(N, K)
    if m != 0:
        tmp1 = N % (tmp + 1)
else:
    tmp = abs(N - K)
    tmp1 = min(N % K, tmp)

print(tmp1)
N,K=map(int, input().split())
m=int(N/K)

min_1 = abs(N-m*K)
min_2 = abs(min_1-K)

if N==0:
  print(K)
else:
  print(min(min_1, min_2))
n,k = map(int, input().split())

if n < abs(n-k):
  print(n)
  exit()

n = abs(n-k) % k

if n == 0:
  print(n)
  exit()

print(abs(n-k))
# ABC161C

def f(n, k):
    for i in range(10):
        if n < k:
            print(n)
        else:
            m =  n % k
            if m <= k:
                print(m)
            else:
                n = abs(n - k)
                print(k)

n, k = map(int, input().split())
f(n, k)
N,K = map(int,input().split())

def replace(N,K):
    if(K == 1 or N==K):
        return 0
    if(N<K):
        return N
    else:
        while(abs(N-K)>=0):
            N = N-(K*(N//K))
            if(N == 0 ):
                return 0                
            elif (N-K<0):
                return abs(N-K)
                
print(replace(N,K))
# coding : utf-8

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

flag = 0

alpha = N / K

cad = [N - (alpha-1)*K, N - alpha*K, N - (alpha+1)*K]
cad = list(map(abs, cad))

print(int(min(cad)))
n,k=map(int,input().split())
if n<k:
    print(n)

elif n%k==0:
    print(0)
else:
    t=n//k
    s=(t+1)*k-n
    r=n-t*k
    print(min(r,s))
N, K = map(int, input().split())

if N % K == 0:
  print(0)
  
while True:
  N = N - K
  if N < 0:
    print(N + K)
    exit()
n,k=map(int,input().split())
print(min(n%k,k-n%k) if n >= k else min(n,n-k))
N,K=map(int,input().split())
ZET=N
b=0
c=N
b1=N
for i in range(1000000000000000000):
  c=abs(b1-K)
  if b>c:
    break
  b1=c
  b=c
print(c)
N,K=map(int,input().split())
G=N-K
if N>=0:
    print(abs(G-K))
else:
    print(0)
N, K = map(int, input().split())

N_set = set([])
N_set.add(float('inf'))
N_new = N

while (N_new > 0 and N_new < min(N_set)):
    N_set.add(N_new)
    if N_new >= K:
        N_new = N_new % K
    else:
        N_new = K - N_new
    print("N_new", N_new)

N_set.add(N_new)

ans = min(N, min(N_set))

print(ans)
import fractions
N, K = map(int, input().split())

k = fractions.gcd(N, K)

if K == 1:
    print(0)
else:
    print(k)
N,K = map(int,input().split())
if N == K:
  print(0)
elif N < K:
  print(N)
elif N > K:
  tmp = N%K
  a = K-tmp
  b = tmp
  if a < b:
    print(a)
  elif a > b:
    print(b)
k = input().split()
s = int(k[0])
j = int(k[1])
v = s + 1
if s > 100 * j:
    s = j + 100
while v > s:
    v = s
    s = abs(s - j)

v = s
s = abs(s-j)
if v > s:
  print(s)
else:
  print(v)
N, K = map(int, input().split())

a = N - (N // K)*K

if N < K:
        print(N)
else:
        m = 1000000000000000000
        for i in range(100):
                a = abs(a - K)
                if a < m:
                        m = a 
        print(m)
def gcd(x, y):
    return x if y == 0 else gcd(y, x % y)

n, k = map(int, input().split())
a = gcd(n, k)
print(min(a, k - a))
#!/usr/bin/env python3

N, K = map(int, input().split())
if N <=K:
    print(min(abs(N-K), N))
else:
    print(N%K)
s = input()
print('Yes' if s[2]==s[3] and s[4]==s[5] else 'No')
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
s=input()
if s[2]==s[3] and s[4]==s[5]:
  print('Yes')
else:
  print('No')
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    s=STR()
    if s[2]==s[3] and s[4]==s[5]:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()
ls = list(map(str,input()))
if (ls[2] == ls[3]) and (ls[4] == ls[5]):
    print("Yes")
else:
    print("No")
S = list(input())
if (S[2]==S[3]) & (S[4]==S[5]):
    print("Yes")
else:
    print("No")
coffee = input()

if len(coffee) != 6:
    print("文字数が異なります")

if coffee[2] == coffee[3] and coffee[4] == coffee[5]:
    print("Yes")
else:
    print("No")
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
x=input()
if x[2]==x[3] and x[4]==x[5]:
  print('Yes')
else:
  print('No')
s=input()

if(s[2]==s[3] and s[4]==s[5]):
    print("Yes")
else:
    print("No")
import sys

s = sys.stdin.readline()
if s[2] == s[3] and s[4] == s[5]:
  sys.stdout.write("Yes")
else:
  sys.stdout.write("No")
S=str(input())
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
s = input()
 
if(s[2] == s[3] and s[4] == s[5]):
  print("Yes")
else:
  print("No")
ipt = input()
input_list = list(ipt)
if input_list[2] == input_list[3] and input_list[4] == input_list[5]:
    print('Yes')
else:
    print('No')
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')
S = input()
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
else:
  print("No")
s = list(input())

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

S = list(S)
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
def resolve():
    s = input()
    if s[2]==s[3] and s[4]==s[5]:
        print('Yes')
    else:
        print('No')

resolve()
S=input()
if S[2]==S[3]:
    if S[4]==S[5]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
s = input()
# 入力したsの3文字目つまりリストの3-1が4-1と一緒
# 同様に5-1と6-1が一緒ならyes
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else: print('No')
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    S = input()
    print('Yes'if S[2] == S[3] and S[4] == S[5] else 'No')


if __name__ == "__main__":
    main()
S = list(input())
print('Yes') if S[2] == S[3] and S[4] == S[5] else print('No')
S = input()

if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
string=input()
print("Yes" if string[2]==string[3] and string[4]==string[5] else "No")
a = input()
b = []
for z in a:
  b.append(z)
if b[2]==b[3]:
  if b[4]==b[5]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
s=input()
print("Yes" if s[2]==s[3] and s[4]==s[5] else "No")
S = input()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')
import sys
import math
from collections import Counter

s = sys.stdin.readline().strip()

if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
word=input()
if word[2]==word[3] and word[4]==word[5]:
  print("Yes")
else:
  print("No")
S = input()

if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
S = input()

print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
S = input()

if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
S = input()

print('Yes' if S[2] == S[3] and S[4] == S[5] else 'No')
a = input()

if(a[2]==a[3] and a[4]==a[5]):
  print("Yes")
else:
  print("No")
# import sys
# input = sys.stdin.readline
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
S = input()
if S[2]==S[3]:
    if S[4]==S[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
a = list(input())

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

print(ans)
# -*- coding: utf-8 -*-
S= input()
S_list = list(S)
if S_list[2] == S_list[3]:
    if S_list[4] == S_list[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
s=input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")
S = str(input())
if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
s = str(input())

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

if s[2]==s[3] and s[4]==s[5] : print('Yes')
else : print('No')
s = list(str(input()))
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
def main():
    s = input()

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

if __name__ == "__main__":
    main()
S = input()

if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')
string = list(input())
if string[2] == string[3] and string[4] == string[5]:
    print("Yes")
else:
    print("No")
S = str(input())
 
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
S = input().strip()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
s = input()

if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
else:
  print("No")
s = input()
if(s[2] == s[3] and s[4] == s[5]):
    print("Yes")
else:
    print("No")
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
h=input()
if(h[2]==h[3] and h[4]==h[5]):
    print("Yes")
else:
    print("No")
S = input()
if(S[2]==S[3] and S[4]==S[5]):
    print('Yes')
else:
    print('No')
s = list(str(input()))
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
S = input()
print('Yes' if S[2] == S[3] and S[4] == S[5] else 'No')
s = input()
print('Yes' if s[2] == s[3] and s[4] == s[5] else 'No')
s = str(input())

if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')
import sys

input = sys.stdin.readline

S = input().strip()

if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')
S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
S = input()
if S[2] == S[3] and S[4]==S[5]:
  print('Yes')
else:
  print('No')
a = input()
print("Yes" if a[2]==a[3] and a[4]==a[5] else "No")
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print('Yes')
else:
  print('No')
s=input()

if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")
s = input()
print(("Yes" if s[2] == s[3] and s[4] == s[5] else "No"))
S=input()
S=str(S)
a=len(S)
if a==6:
    if S[2]==S[3]:
        if S[4]==S[5]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
test = str(input())
if test[2] == test[3] and test[4] == test[5]:
  print('Yes')
else:
  print('No')
a=input()
if a[2]==a[3] and a[4]==a[5]:
  print("Yes")
else:
  print("No")
N = input()
if N[-4] == N[-3] and N[-2] == N[-1] : 
    print("Yes")
else :
    print("No")
S = input()

if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
n = input()
if len(n)==6 and n[2]==n[3] and n[4]==n[5]:
	print("Yes")
else:
	print("No")
cf = str(input())

if cf[2] == cf[3]:
	 if cf[4] == cf[5]:
	 	print("Yes")
	 else:
	 	print("No")
else:
	print("No")
a,b,c,d,e,f =input()

if c == d and e == f :
  print("Yes")
else: print("No")
st = input()
if st[2]==st[3] and st[4]==st[5]:
  print('Yes')
else:
  print('No')
S = input()
if S[2] == S[3] and S[4] == S [5]:
    print('Yes')
else:
    print('No')
a = list(input().rstrip())
print('Yes') if (a[2] == a[3] and a[4] == a[5]) else print('No')
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
s = input()

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

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

if s[2] == s[3] and s[4] == s[5]:
	print('Yes')
else:
	print('No')
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    S = input().strip()
    if len(S) != 6:
        return "No"
    if S[2] == S[3] and S[4] == S[5]:
        return "Yes"
    else:
        return "No"


if __name__ == "__main__":
    print(main())
i = input()
if i[-4]==i[-3] and i[-2]==i[-1]:
    print("Yes")
else:
    print("No")
N = input()

if N[2] == N[3]:
    if N[4] == N[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# ABC160 A

def main():
    s = input()

    if s[2] == s[3] and s[4] == s[5]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
inp = input()
print('Yes' if inp[2] == inp[3] and inp[4] == inp[5] else 'No')
s=input()
if (s[2]==s[3] and s[4]==s[5]):
    print('Yes')
else:
    print('No')
s = input()

if s[2] == s[3] and s[4] ==s[5]:
    print('Yes')
else:
    print('No')
s = input()
print("Yes" if s[2] == s[3] and s[4] == s[5] else "No")
n = input()
if n[2]==n[3] and n[4]==n[5]:
  print("Yes")
else:
  print("No")
S = input()
if S[2] == S[3] :
    if S[4] == S[5] :
        print("Yes")
    else :
        print("No")
else :
    print("No")
s=input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
s = input()

if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')
S=list(input())
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
s = input()

if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
s=input();print('YNeos'[not(s[2]==s[3] and s[4]==s[5])::2])
li=list(input())
a=li[2]
b=li[3]
c=li[4]
d=li[5]
if a==b:
    if c==d:
        print('Yes')
    else:
        print('No')
else:
    print('No')
s = input()

if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')
s=str(input())
if s[2]==s[3] and s[4]==s[5]:
  print('Yes')
else:
  print('No')
s = list(input())
if (s[2] == s[3]) and (s[4] == s[5]):
  print("Yes")
else:
  print("No")
S = input()
if (S[2]==S[3])&(S[4]==S[5]):
  print("Yes")
else:
  print("No")
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    S = list(S)
    print('Yes'if S[2] == S[3] and S[4] == S[5] else'No')



if __name__ == '__main__':
    main()
a = input()
if a[2] == a[3] and a[4] == a[5]:
  print("Yes")
else:
  print("No")
a=input();
if a[3]==a[2] and a[5]==a[4]:
	print("Yes");
else:
	print("No")
s=input()

if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
S = input()
m = list(S)
ans = 'No'

if (m[2] == m[3]) and (m[4] == m[5]):
  ans = 'Yes'

print(ans)
def main():
    s = input()

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


if __name__ == '__main__':
    main()
S = input()

if S[2]==S[3] and S[4]==S[5]:
    print('Yes')

else:
    print('No')
from sys import stdin

def main():

    a = stdin.readline().rstrip()
    
    if a[2] == a[3] and a[4] == a[5]:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()
date=input()
date=list(date)
if date[2]==date[3] and date[4]==date[5]:
  print("Yes")
else:
  print("No")
i = input()

san = i[2]
yon = i[3]
go = i[4]
roku = i[5]

if san == yon and go ==roku:
    print("Yes")
else:
    print('No')
import numpy as np
S = input()

if S[2] == S[3]:
    if S[4] == S[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
s = input()
if s[2] == s[3] and s[4] ==s[5]:
    print("Yes")
else:
    print("No")
n= input()
if n[3]==n[2] and n[4]==n[5]:
    print("Yes")
else:
    print("No")
s = list(input())
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
s=input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
if __name__ == "__main__":
    a = (input())
    if a[2]==a[3] and a[4]==a[5]:
        print("Yes")
    else:
        print("No")
str1 = str(input())
if str1[2] == str1[3] and str1[4] == str1[5]:
    print('Yes')
else:
    print('No')
import math
# map(int, input().split())
# int(input())
# input().split()
S = input()
if S[2] == S[3] and S[4] == S[5]: print("Yes")
else: print("No")
S = str(input())
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
S = str(input())
print('Yes' if S[2]==S[3] and S[4]==S[5] else 'No')
S=list(str(input()))
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")