import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    }

} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    }

} Main public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    } main {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String string = scanner.next(); string scanner.next() scanner.next scanner scanner.close() scanner.close scanner boolean result = false; result false boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4)); firstCondition string.substring(2).startsWith(string.substring(3, 4)) string.substring(2).startsWith string.substring(2) string.substring string 2 string.substring(3, 4) string.substring string 3 4 boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6)); secondCondition string.substring(4).startsWith(string.substring(5, 6)) string.substring(4).startsWith string.substring(4) string.substring string 4 string.substring(5, 6) string.substring string 5 6 result = firstCondition && secondCondition result firstCondition && secondCondition firstCondition secondCondition System.out.println(result ? "Yes" : "No") System.out.println System.out System System.out result ? "Yes" : "No" result "Yes" "No" String[] args args public class Main
{
    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    }

} public class Main
{
    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    }

} Main
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
	Scanner scanner = new Scanner(System.in);

	String string = scanner.next();
	scanner.close();

	boolean result = false;

	boolean firstCondition = string.substring(2).startsWith(string.substring(3, 4));
	boolean secondCondition = string.substring(4).startsWith(string.substring(5, 6));

	result = firstCondition && secondCondition;

	System.out.println(result ? "Yes" : "No");
    }

}