import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	}

} 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.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char[] alphabet = new char[26]; alphabet new char[26] 26 for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			alphabet[s.charAt(i)-'A']++;
		} {
			alphabet[s.charAt(i)-'A']++;
		} alphabet[s.charAt(i)-'A']++ alphabet[s.charAt(i)-'A'] alphabet s.charAt(i)-'A' s.charAt(i) s.charAt s i 'A' boolean flag = false; flag false for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		} int i = 0; int i = 0; i 0 i < alphabet.length i alphabet.length alphabet alphabet.length i++ i++ i {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		} {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		} if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			} alphabet[i] == 1 alphabet[i] alphabet i 1 {
				flag = true;
			} flag = true flag true if(alphabet[i] == 4) {
				flag = true;
			} alphabet[i] == 4 alphabet[i] alphabet i 4 {
				flag = true;
			} flag = true flag true System.out.println((flag)?"No":"Yes") System.out.println System.out System System.out (flag)?"No":"Yes" (flag) "No" "Yes" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] alphabet = new char[26];
		for (int i = 0; i < s.length(); i++) {
			alphabet[s.charAt(i)-'A']++;
		}		
		boolean flag = false;
		for (int i = 0; i < alphabet.length; i++) {
			if(alphabet[i] == 1) {
				flag = true;
			}else if(alphabet[i] == 4) {
				flag = true;
			}
		}
		System.out.println((flag)?"No":"Yes");
	}

}
