import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			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 scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String input = scanner.nextLine(); input scanner.nextLine() scanner.nextLine scanner char a = input.charAt(0); a input.charAt(0) input.charAt input 0 char b = input.charAt(1); b input.charAt(1) input.charAt input 1 char c = input.charAt(2); c input.charAt(2) input.charAt input 2 int flagA = 0; flagA 0 int flagB = 0; flagB 0 int flagC = 0; flagC 0 for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		} int i = 0; int i = 0; i 0 i <= 3 i 3 i++ i++ i {
			if (a == input.charAt(i)) {
				flagA++;
			}
		} {
			if (a == input.charAt(i)) {
				flagA++;
			}
		} if (a == input.charAt(i)) {
				flagA++;
			} a == input.charAt(i) a input.charAt(i) input.charAt input i {
				flagA++;
			} flagA++ flagA for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		} int i = 0; int i = 0; i 0 i <= 3 i 3 i++ i++ i {
			if (b == input.charAt(i)) {
				flagB++;
			}
		} {
			if (b == input.charAt(i)) {
				flagB++;
			}
		} if (b == input.charAt(i)) {
				flagB++;
			} b == input.charAt(i) b input.charAt(i) input.charAt input i {
				flagB++;
			} flagB++ flagB for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		} int i = 0; int i = 0; i 0 i <= 3 i 3 i++ i++ i {
			if (c == input.charAt(i)) {
				flagC++;
			}
		} {
			if (c == input.charAt(i)) {
				flagC++;
			}
		} if (c == input.charAt(i)) {
				flagC++;
			} c == input.charAt(i) c input.charAt(i) input.charAt input i {
				flagC++;
			} flagC++ flagC if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} flagA == 2 && flagB == 2 && flagC == 2 flagA == 2 && flagB == 2 && flagC == 2 flagA == 2 flagA 2 flagB == 2 flagB 2 flagC == 2 flagC 2 {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} 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 scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();

		char a = input.charAt(0);
		char b = input.charAt(1);
		char c = input.charAt(2);
		int flagA = 0;
		int flagB = 0;
		int flagC = 0;
		for (int i = 0; i <= 3; i++) {
			if (a == input.charAt(i)) {
				flagA++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (b == input.charAt(i)) {
				flagB++;
			}
		}
		for (int i = 0; i <= 3; i++) {
			if (c == input.charAt(i)) {
				flagC++;
			}
		}

		if (flagA == 2 && flagB == 2 && flagC == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
