

import java.util.Scanner;

public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
	
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
	
} Main public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	} main {
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String s=scan.next().toUpperCase(); s scan.next().toUpperCase() scan.next().toUpperCase scan.next() scan.next scan char a[]=s.toCharArray(); a s.toCharArray() s.toCharArray s int count=0; count 0 int freq[]=new int[26]; freq new int[26] 26 for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			freq[a[i]-'A']++;
		} {
			freq[a[i]-'A']++;
		} freq[a[i]-'A']++ freq[a[i]-'A'] freq a[i]-'A' a[i] a i 'A' for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		} int i=0; int i=0; i 0 i<26 i 26 i++ i++ i {
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		} {
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		} if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			} freq[i]==2 ||freq[i]==0 freq[i]==2 freq[i] freq i 2 freq[i]==0 freq[i] freq i 0 {
				
			} {
				System.out.println("No");
				return;
			} System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String args[] args public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
	
} public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
	
} Main


import java.util.Scanner;

public class Main {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		String s=scan.next().toUpperCase();
		char a[]=s.toCharArray();
		int count=0;
		int freq[]=new int[26];
		for(int i=0;i<a.length;i++)
		{
			freq[a[i]-'A']++;
		}
		for(int i=0;i<26;i++)
		{
			if(freq[i]==2 ||freq[i]==0) {
				
			}else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
	
}
