fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let s = read::<String>();
    let cs = s.chars().collect::<Vec<char>>();

    if cs[2] == cs[3] && cs[4] == cs[5] {
        println!("Yes");
    } else {
        println!("No");
    }
}