S=str(eval(input()))



if S[2]==S[3] and S[4]==S[5]:

  print('Yes')

else:

  print('No')
s=str(eval(input()))

if s[2]==s[3] and s[4]==s[5]:

  print('Yes')

else:

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

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

-S = str(eval(input())) -if S[2] == S[3] and S[4] == S[5]: +s = str(eval(input())) +if s[2] == s[3] and s[4] == s[5]: