S = list(eval(input()))



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

    print('Yes')

else:

    print('No')
S = list(eval(input()))

print(('YNeos'[S[2::2]!=S[3::2]::2]))

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

S = list(eval(input()))
print(("YNeos"[S[2::2] != S[3::2] :: 2]))

-if S[2] == S[3] and S[4] == S[5]: -    print("Yes") -else: -    print("No") +print(("YNeos"[S[2::2] != S[3::2] :: 2]))