import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	}

} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	} main {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String S=scan.next(); S scan.next() scan.next scan String d[]=S.split(""); d S.split("") S.split S "" String a="No"; a "No" if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		} d[2].equals(d[3]) d[2].equals d[2] d 2 d[3] d 3 {
			if(d[4].equals(d[5])){
				a="Yes";
			}
		} if(d[4].equals(d[5])){
				a="Yes";
			} d[4].equals(d[5]) d[4].equals d[4] d 4 d[5] d 5 {
				a="Yes";
			} a="Yes" a "Yes" System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String S=scan.next();
		String d[]=S.split("");
		String a="No";
		if(d[2].equals(d[3])){
			if(d[4].equals(d[5])){
				a="Yes";
			}
		}
		System.out.println(a);
	}

}