import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int count = 0; count 0 String result = ""; result "" if (S.charAt(2) == S.charAt(3)) {
            count++;
        } S.charAt(2) == S.charAt(3) S.charAt(2) S.charAt S 2 S.charAt(3) S.charAt S 3 {
            count++;
        } count++ count if (S.charAt(4) == S.charAt(5)) {
            count++;
        } S.charAt(4) == S.charAt(5) S.charAt(4) S.charAt S 4 S.charAt(5) S.charAt S 5 {
            count++;
        } count++ count if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        } count == 2 count 2 {
            result = "Yes";
        } result = "Yes" result "Yes" {
            result = "No";
        } result = "No" result "No" PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(result) out.println out result sc.close() sc.close sc out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    }
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int count = 0;
        String result = "";

        if (S.charAt(2) == S.charAt(3)) {
            count++;
        }

        if (S.charAt(4) == S.charAt(5)) {
            count++;
        }

        if (count == 2) {
            result = "Yes";
        } else {
            result = "No";
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);
        sc.close();
        out.flush();
    }
}