# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
bl = False
if S[2] == S[3] and S[4] == S[5]:
    bl = True

print('Yes' if bl else 'No')

f18aa11cddf24da6c1b575f94af3b7c2d2cf3239
<mask token>

<mask token>
if S[2] == S[3] and S[4] == S[5]:
    bl = True
print('Yes' if bl else 'No')

<mask token>
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
S = sr()
bl = False
if S[2] == S[3] and S[4] == S[5]:
    bl = True
print('Yes' if bl else 'No')

import sys
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
S = sr()
bl = False
if S[2] == S[3] and S[4] == S[5]:
    bl = True
print('Yes' if bl else 'No')

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
bl = False
if S[2] == S[3] and S[4] == S[5]:
    bl = True

print('Yes' if bl else 'No')
