        import java.util.*;
                 
        class Main{
            public static void main(String[] args) {
                
                try(Scanner sc = new Scanner(System.in)){
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                }catch(Exception e){
                    e.printStackTrace();
                }        
            }
        } import java.util.*; util.* java class Main{
            public static void main(String[] args) {
                
                try(Scanner sc = new Scanner(System.in)){
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                }catch(Exception e){
                    e.printStackTrace();
                }        
            }
        } Main public static void main(String[] args) {
                
                try(Scanner sc = new Scanner(System.in)){
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                }catch(Exception e){
                    e.printStackTrace();
                }        
            } main {
                
                try(Scanner sc = new Scanner(System.in)){
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                }catch(Exception e){
                    e.printStackTrace();
                }        
            } try(Scanner sc = new Scanner(System.in)){
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                }catch(Exception e){
                    e.printStackTrace();
                } catch(Exception e){
                    e.printStackTrace();
                } Exception e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc String str3 = str.substring(2, 3); str3 str.substring(2, 3) str.substring str 2 3 String str4 = str.substring(3, 4); str4 str.substring(3, 4) str.substring str 3 4 String str5 = str.substring(4, 5); str5 str.substring(4, 5) str.substring str 4 5 String str6 = str.substring(5, 6); str6 str.substring(5, 6) str.substring str 5 6 if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No"); str3.equals(str4) && str5.equals(str6) str3.equals(str4) str3.equals str3 str4 str5.equals(str6) str5.equals str5 str6 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" String[] args args
        import java.util.*;
                 
        class Main{
            public static void main(String[] args) {
                
                try(Scanner sc = new Scanner(System.in)){
         
                    String str = sc.next();
                    String str3 = str.substring(2, 3);
                    String str4 = str.substring(3, 4);
         
                    String str5 = str.substring(4, 5);
                    String str6 = str.substring(5, 6);
         
                    if(str3.equals(str4) && str5.equals(str6))System.out.println("Yes");
                    else System.out.println("No");
                    
                }catch(Exception e){
                    e.printStackTrace();
                }        
            }
        }