import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String[] sArray = new String[S.length()]; sArray new String[S.length()] S.length() S.length S for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        } {
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        } String s2 = String.valueOf(S.charAt(i)); s2 String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i sArray[i] = s2 sArray[i] sArray i s2 if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        } sArray[2].equals(sArray[3]) sArray[2].equals sArray[2] sArray 2 sArray[3] sArray 3 {
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        } if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            } sArray[4].equals(sArray[5]) sArray[4].equals sArray[4] sArray 4 sArray[5] sArray 5 {
                System.out.print("Yes");
            } System.out.print("Yes") System.out.print System.out System System.out "Yes" {
                System.out.print("No");
            } System.out.print("No") System.out.print System.out System System.out "No" {
            System.out.print("No");
        } System.out.print("No") System.out.print System.out System System.out "No" String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        
        String[] sArray = new String[S.length()];
        for(int i = 0; i < S.length(); i++){
            String s2 = String.valueOf(S.charAt(i));
            sArray[i] = s2;
        }
        
        if(sArray[2].equals(sArray[3])){
            if(sArray[4].equals(sArray[5])){
                System.out.print("Yes");
            }else{
                System.out.print("No");
            }
        }else{
            System.out.print("No");
        }
        
    }
}