import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	}
} 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();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc sc.close() sc.close sc String[] spl = s.split(""); spl s.split("") s.split s "" String ss = spl[0]; ss spl[0] spl 0 if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		} spl[1].equals(ss) spl[1].equals spl[1] spl 1 ss {
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		} if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			} spl[2].equals(ss) spl[2].equals spl[2] spl 2 ss {
				//AAAS
				System.out.println("No");
				return;
			} System.out.println("No") System.out.println System.out System System.out "No" return; {
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			} if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				} spl[3].equals(ss) spl[3].equals spl[3] spl 3 ss {
					//AASA
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; {
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				} if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					} spl[2].equals(spl[3]) spl[2].equals spl[2] spl 2 spl[3] spl 3 {
						//AASS
						System.out.println("Yes");
						return;
					} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; {
						//AASD
						System.out.println("No");
						return;
					} System.out.println("No") System.out.println System.out System System.out "No" return; {
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		} if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			} spl[2].equals(ss) spl[2].equals spl[2] spl 2 ss {
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			} if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				} spl[1].equals(spl[3]) spl[1].equals spl[1] spl 1 spl[3] spl 3 {
					//ASAS
					System.out.println("Yes");
					return;
				} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; {
					//ASAD
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			} spl[2].equals(spl[1]) spl[2].equals spl[2] spl 2 spl[1] spl 1 {
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			} if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				} spl[3].equals(ss) spl[3].equals spl[3] spl 3 ss {
					//ASSA
					System.out.println("Yes");
					return;
				} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; {
					//ASSD
					System.out.println("No");
					return;
				} System.out.println("No") System.out.println System.out System System.out "No" return; {
				//ASD*
				System.out.println("No");
				return;
			} System.out.println("No") System.out.println System.out System System.out "No" return; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();

		String[] spl = s.split("");
		String ss = spl[0];
		if(spl[1].equals(ss)){
			if(spl[2].equals(ss)){
				//AAAS
				System.out.println("No");
				return;
			}else{
				if(spl[3].equals(ss)){
					//AASA
					System.out.println("No");
					return;
				}else{
					if(spl[2].equals(spl[3])){
						//AASS
						System.out.println("Yes");
						return;
					}else{
						//AASD
						System.out.println("No");
						return;
					}
				}
			}
		}else{
			if(spl[2].equals(ss)){
				if(spl[1].equals(spl[3])){
					//ASAS
					System.out.println("Yes");
					return;
				}else{
					//ASAD
					System.out.println("No");
					return;
				}
			}else if(spl[2].equals(spl[1])){
				if(spl[3].equals(ss)){
					//ASSA
					System.out.println("Yes");
					return;
				}else{
					//ASSD
					System.out.println("No");
					return;
				}
			}else{
				//ASD*
				System.out.println("No");
				return;
			}
		}
	}
}