import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char [] sArray = s.toCharArray(); sArray s.toCharArray() s.toCharArray s int count = 0; count 0 for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		} int i = 1; int i = 1; i 1 i < 4 i 4 i++ i++ i {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		} {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		} if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			} sArray[0] == sArray[i] sArray[0] sArray 0 sArray[i] sArray i {
				count++;
				sArray[i] = 0;
			} count++ count sArray[i] = 0 sArray[i] sArray i 0 if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		} count != 1 count 1 {
			System.out.println("No");
			return;
		} System.out.println("No") System.out.println System.out System System.out "No" return; {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		} for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			} int i = 1; int i = 1; i 1 i < 4 i 4 i++ i++ i {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			} {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			} if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				} sArray[i] == 0 sArray[i] sArray i 0 {
					continue;
				} continue; {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				} for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					} int j = i + 1; int j = i + 1; j i + 1 i 1 j < 4 j 4 j++ j++ j {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					} {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					} if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						} sArray[i] == sArray[j] sArray[i] sArray i sArray[j] sArray j {
							System.out.println("Yes");
							return;
						} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; 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 sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char [] sArray = s.toCharArray();
		int count = 0;
		for (int i = 1; i < 4; i++) {
			if (sArray[0] == sArray[i]) {
				count++;
				sArray[i] = 0;
			}
		}
		if (count != 1) {
			System.out.println("No");
			return;
		} else {
			for (int i = 1; i < 4; i++) {
				if (sArray[i] == 0) {
					continue;
				} else {
					for (int j = i + 1; j < 4; j++) {
						if (sArray[i] == sArray[j]) {
							System.out.println("Yes");
							return;
						}
					}
				}
			}
		}
		System.out.println("No");
	}
}