import java.util.Scanner;
public class Main
{
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			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 input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
} Main public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No");
	} main {
		Scanner input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No");
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) String s = input.nextLine(); s input.nextLine() input.nextLine input char[] words = new char[6]; words new char[6] 6 for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		} int i=0; int i=0; i 0 i<6 i 6 i++ i++ i {
			words[i] = s.charAt(i);
		} {
			words[i] = s.charAt(i);
		} words[i] = s.charAt(i) words[i] words i s.charAt(i) s.charAt s i if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No"); words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1] words[1]!=words[4] words[1]!=words[2] words[0]!=words[4] words[0]!=words[2] words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1] words[2]==words[3] words[2] words 2 words[3] words 3 words[4]==words[5] words[4] words 4 words[5] words 5 words[0]!=words[2] words[0] words 0 words[2] words 2 words[0]!=words[4] words[0] words 0 words[4] words 4 words[1]!=words[2] words[1] words 1 words[2] words 2 words[1]!=words[4] words[1] words 1 words[4] words 4 words[0]!=words[1] words[0] words 0 words[1] words 1 System.out.println("Yes") System.out.println System.out System System.out "Yes" 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 input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
} public class Main
{
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
} Main
import java.util.Scanner;
public class Main
{
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		String s = input.nextLine();
		
		char[] words = new char[6];
		for (int i=0;i<6;i++)
		{
			words[i] = s.charAt(i);
		}

		if (
			words[2]==words[3]&&
			words[4]==words[5]&&
			words[0]!=words[2]&&
			words[0]!=words[4]&&
			words[1]!=words[2]&&
			words[1]!=words[4]&&
			words[0]!=words[1]
			)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
}