s=eval(input())

res="No"

if len(s)==6 and s[2]==s[3] and s[4]==s[5]:res="Yes"

print(res)
s=eval(input())

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

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

-res = "No" -if len(s) == 6 and s[2] == s[3] and s[4] == s[5]: -    res = "Yes" -print(res) +print(("Yes" if s[2] == s[3] and s[4] == s[5] else "No"))