
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		String S = sc.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		}
	}




 import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.List; List java.util 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.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		}
	} Main public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		String S = sc.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		} main {

		Scanner sc = new Scanner(System.in);

		String S = sc.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc String [] strArray = new String[S.length()]; strArray new String[S.length()] S.length() S.length S for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		} {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		} String ans = String.valueOf(S.charAt(i)); ans String.valueOf(S.charAt(i)) String.valueOf String S.charAt(i) S.charAt S i strArray[i] = ans strArray[i] strArray i ans List<String> s3 = Arrays.asList(strArray[2]); s3 Arrays.asList(strArray[2]) Arrays.asList Arrays strArray[2] strArray 2 List<String> s4 = Arrays.asList(strArray[3]); s4 Arrays.asList(strArray[3]) Arrays.asList Arrays strArray[3] strArray 3 List<String> s5 = Arrays.asList(strArray[4]); s5 Arrays.asList(strArray[4]) Arrays.asList Arrays strArray[4] strArray 4 List<String> s6 = Arrays.asList(strArray[5]); s6 Arrays.asList(strArray[5]) Arrays.asList Arrays strArray[5] strArray 5 if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		} Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6) Collections.disjoint(s3,s4) Collections.disjoint Collections s3 s4 Collections.disjoint(s5,s6) Collections.disjoint Collections s5 s6 {
			
			System.out.print("No");

		} System.out.print("No") System.out.print System.out System System.out "No" {
			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 sc = new Scanner(System.in);

		String S = sc.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		}
	} public class Main{
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		String S = sc.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		}
	} Main

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		String S = sc.nextLine();

		String [] strArray = new String[S.length()];

		for (int i=0; i<S.length(); i++) {
			String ans = String.valueOf(S.charAt(i));
			strArray[i] = ans;

		}
		List<String> s3 = Arrays.asList(strArray[2]);
		List<String> s4 = Arrays.asList(strArray[3]);
		List<String> s5 = Arrays.asList(strArray[4]);
		List<String> s6 = Arrays.asList(strArray[5]);

		if (Collections.disjoint(s3,s4) || Collections.disjoint(s5,s6)) {
			
			System.out.print("No");

		}else {
			System.out.print("Yes");
		}

		}
	}





