import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                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) {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }else{
            System.out.println("No");
        }
    }
} Main public static void main(String[] args) {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }else{
            System.out.println("No");
        }
    } main {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }else{
            System.out.println("No");
        }
    } final Scanner input = new Scanner(System.in); input new Scanner(System.in) char[] text = input.nextLine().trim().toCharArray(); text input.nextLine().trim().toCharArray() input.nextLine().trim().toCharArray input.nextLine().trim() input.nextLine().trim input.nextLine() input.nextLine input if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }else{
            System.out.println("No");
        } text.length >= 6 text.length text text.length 6 {
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        } if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            } text[3-1]==text[4-1] && text[5-1] ==text[6-1] text[3-1]==text[4-1] text[3-1] text 3-1 3 1 text[4-1] text 4-1 4 1 text[5-1] ==text[6-1] text[5-1] text 5-1 5 1 text[6-1] text 6-1 6 1 {
                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" {
            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) {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }else{
            System.out.println("No");
        }
    }
} public class Main {

    public static void main(String[] args) {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                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) {
        final Scanner input = new Scanner(System.in);

        char[] text = input.nextLine().trim().toCharArray();
        if(text.length >= 6){
            if(text[3-1]==text[4-1] && text[5-1] ==text[6-1]){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }else{
            System.out.println("No");
        }
    }
}
