import java.util.*;

public class Main{
  public static void main (String args[]){
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main (String args[]){
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} Main public static void main (String args[]){
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } main {
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) char[][] mozi = new char[1][6]; mozi new char[1][6] 1 6 for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    } int i = 0; int i = 0; i 0 i<1 i 1 i++ i++ i {
      mozi[i] = scan.next().toCharArray();
    } {
      mozi[i] = scan.next().toCharArray();
    } mozi[i] = scan.next().toCharArray() mozi[i] mozi i scan.next().toCharArray() scan.next().toCharArray scan.next() scan.next scan int x = 0; x 0 if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    } mozi[0][2] == mozi[0][3] mozi[0][2] mozi[0] mozi 0 2 mozi[0][3] mozi[0] mozi 0 3 {
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    } if(mozi[0][4] == mozi[0][5]){
        x = 1;
      } mozi[0][4] == mozi[0][5] mozi[0][4] mozi[0] mozi 0 4 mozi[0][5] mozi[0] mozi 0 5 {
        x = 1;
      } x = 1 x 1 if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    } x == 1 x 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" String args[] args public class Main{
  public static void main (String args[]){
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} public class Main{
  public static void main (String args[]){
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} Main
import java.util.*;

public class Main{
  public static void main (String args[]){
    Scanner scan = new Scanner(System.in);

    char[][] mozi = new char[1][6];

    for(int i = 0;i<1;i++){
      mozi[i] = scan.next().toCharArray();
    }
    int x = 0;
    if(mozi[0][2] == mozi[0][3]){
      if(mozi[0][4] == mozi[0][5]){
        x = 1;
      }
    }
    if(x == 1){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}
