import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	}

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

	public static void main(String[] args) {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	}

} Main public static void main(String[] args) {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	} main {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	} String S; S Scanner sc = new Scanner(System.in); sc new Scanner(System.in) S = sc.next() S sc.next() sc.next sc char s_3; s_3 char s_4; s_4 char s_5; s_5 char s_6; s_6 s_3 = S.charAt(2) s_3 S.charAt(2) S.charAt S 2 s_4 = S.charAt(3) s_4 S.charAt(3) S.charAt S 3 s_5 = S.charAt(4) s_5 S.charAt(4) S.charAt S 4 s_6 = S.charAt(5) s_6 S.charAt(5) S.charAt S 5 if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No"); s_3 == s_4 s_3 s_4 {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No"); s_5 == s_6 s_5 s_6 {
				System.out.println("Yes");
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {

	public static void main(String[] args) {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	}

} public class Main {

	public static void main(String[] args) {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		String S;
		Scanner sc = new Scanner(System.in);
		S = sc.next();
		char s_3;
		char s_4;
		char s_5;
		char s_6;
		s_3 = S.charAt(2);
		s_4 = S.charAt(3);
		s_5 = S.charAt(4);
		s_6 = S.charAt(5);
		if (s_3 == s_4) {
			if (s_5 == s_6) {
				System.out.println("Yes");
			} else
				System.out.println("No");
		} else
			System.out.println("No");
	}

}