import java.util.Scanner;

public class Main {

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

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	}

}


//import java.util.Scanner;
//
//public class Main {
//
//	public static void main(String[] args){
//		Scanner in = new Scanner(System.in);
//		int n = in.nextInt();
//
//		for(int i = 0; i < n; i++)
//
//		System.out.println(ans);
//	}
//
//} import java.util.Scanner; Scanner java.util public class Main {

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

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	}

} Main public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String s = in.nextLine();
		char[] a = s.toCharArray();

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	} main {
		Scanner in = new Scanner(System.in);
		String s = in.nextLine();
		char[] a = s.toCharArray();

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String s = in.nextLine(); s in.nextLine() in.nextLine in char[] a = s.toCharArray(); a s.toCharArray() s.toCharArray s String ans; ans if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No"; !(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])) !(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) (a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) a[0] == a[1] && a[0] == a[2] && a[0] == a[3] a[0] == a[1] a[0] a 0 a[1] a 1 a[0] == a[2] a[0] a 0 a[2] a 2 a[0] == a[3] a[0] a 0 a[3] a 3 ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])) (a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3]) (a[0] == a[2] && a[1] == a[3]) a[0] == a[2] a[0] a 0 a[2] a 2 a[1] == a[3] a[1] a 1 a[3] a 3 (a[0] == a[3] && a[1] == a[2]) a[0] == a[3] a[0] a 0 a[3] a 3 a[1] == a[2] a[1] a 1 a[2] a 2 (a[0] == a[1] && a[2] == a[3]) a[0] == a[1] a[0] a 0 a[1] a 1 a[2] == a[3] a[2] a 2 a[3] a 3 ans = "Yes" ans "Yes" ans = "No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

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

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	}

} public class Main {

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

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {

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

		String ans;

		if(!(a[0] == a[1] && a[0] == a[2] && a[0] == a[3]) && ((a[0] == a[2] && a[1] == a[3]) || (a[0] == a[3] && a[1] == a[2]) || (a[0] == a[1] && a[2] == a[3])))
ans = "Yes";
else
	ans = "No";

		System.out.println(ans);
	}

}


//import java.util.Scanner;
//
//public class Main {
//
//	public static void main(String[] args){
//		Scanner in = new Scanner(System.in);
//		int n = in.nextInt();
//
//		for(int i = 0; i < n; i++)
//
//		System.out.println(ans);
//	}
//
//}