import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  }
} Main public static void main(String[] args){
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  } main {
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  } Scanner sn = new Scanner(System.in); sn new Scanner(System.in) int cnt = 0; cnt 0 String str = null; str null str = sn.nextLine() str sn.nextLine() sn.nextLine sn char[] c = str.toCharArray(); c str.toCharArray() str.toCharArray str if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    } c[2] == c[3] c[2] c 2 c[3] c 3 {
      cnt++;
    } cnt++ cnt {
      System.out.print("No");
      return;
    } System.out.print("No") System.out.print System.out System System.out "No" return; if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    } c[4] == c[5] c[4] c 4 c[5] c 5 {
      cnt++;
    } cnt++ cnt {
      System.out.print("No");
      return;
    } System.out.print("No") System.out.print System.out System System.out "No" return; if(cnt == 2) {
		System.out.print("Yes");
    } cnt == 2 cnt 2 {
		System.out.print("Yes");
    } System.out.print("Yes") System.out.print System.out System System.out "Yes" String[] args args public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sn = new Scanner(System.in);
    
    int cnt = 0;
    String str = null;
    str = sn.nextLine();
    
    char[] c = str.toCharArray();
    
    if(c[2] == c[3]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
       
    if(c[4] == c[5]) {
      cnt++;
    } else {
      System.out.print("No");
      return;
    }
    
    if(cnt == 2) {
		System.out.print("Yes");
    }
  }
}