import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           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 scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       }
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       }
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String str = scanner.nextLine(); str scanner.nextLine() scanner.nextLine scanner String a = str.substring(2, 3); a str.substring(2, 3) str.substring str 2 3 String b = str.substring(4, 5); b str.substring(4, 5) str.substring str 4 5 String c = str.substring(3, 4); c str.substring(3, 4) str.substring str 3 4 String d = str.substring(5, 6); d str.substring(5, 6) str.substring str 5 6 if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       } a.equals(c) && (b.equals(d)) a.equals(c) a.equals a c (b.equals(d)) b.equals b d {
           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 scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       }
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();

        String a = str.substring(2, 3);
        String b = str.substring(4, 5);
        String c = str.substring(3, 4);
        String d = str.substring(5, 6);

       if (a.equals(c) && (b.equals(d))) {
           System.out.println("Yes");
       } else{
           System.out.println("No");
       }
    }
}