import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    }
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.nextLine(); a sc.nextLine() sc.nextLine sc String first = a.substring(2,4); first a.substring(2,4) a.substring a 2 4 String second = a.substring(4,6); second a.substring(4,6) a.substring a 4 6 String first1 = first.substring(0,1); first1 first.substring(0,1) first.substring first 0 1 String first2 = first.substring(1,2); first2 first.substring(1,2) first.substring first 1 2 String second1 = second.substring(0,1); second1 second.substring(0,1) second.substring second 0 1 String second2 = second.substring(1,2); second2 second.substring(1,2) second.substring second 1 2 if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        } first1.equals(first2) && second1.equals(second2) first1.equals(first2) first1.equals first1 first2 second1.equals(second2) second1.equals second1 second2 {
        	System.out.println("Yes");

        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
        	System.out.println("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) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    }
} public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    }
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        String first = a.substring(2,4);
        String second = a.substring(4,6);
         
        String first1 = first.substring(0,1);
        String first2 = first.substring(1,2);
        
        String second1 = second.substring(0,1);
        String second2 = second.substring(1,2);
        
        if(first1.equals(first2) && second1.equals(second2)) {
        	System.out.println("Yes");

        }else {
        	System.out.println("No");
        }
        
    }
}