import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)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 sc = new Scanner(System.in);
		String N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)System.out.println("Yes");
	else System.out.println("No");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)System.out.println("Yes");
	else System.out.println("No");
	} main {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)System.out.println("Yes");
	else System.out.println("No");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String N = sc.next(); N sc.next() sc.next sc String[] str = N.split(""); str N.split("") N.split N "" String s1 s1 s2 = ""; s2 "" int cnt = 0; cnt 0 s1 = str[0] s1 str[0] str 0 for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		} String a str {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		} {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		} if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			} !((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2)))) ((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2)))) (a.equals(s1) && !a.equals(s2)) a.equals(s1) a.equals a s1 !a.equals(s2) a.equals(s2) a.equals a s2 ((!a.equals(s1) && a.equals(s2))) !a.equals(s1) a.equals(s1) a.equals a s1 a.equals(s2) a.equals a s2 {
				cnt++;
			} cnt++ cnt if (!a.equals(s1) && s2.equals(""))
				s2 = a; !a.equals(s1) && s2.equals("") !a.equals(s1) a.equals(s1) a.equals a s1 s2.equals("") s2.equals s2 "" s2 = a s2 a if(cnt==1)System.out.println("Yes");
	else System.out.println("No"); cnt==1 cnt 1 System.out.println("Yes") System.out.println System.out System System.out "Yes" 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 N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)System.out.println("Yes");
	else System.out.println("No");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)System.out.println("Yes");
	else System.out.println("No");
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		String[] str = N.split("");
		String s1, s2 = "";
		int cnt = 0;
		s1 = str[0];
		for (String a : str) {
			if (!((a.equals(s1) && !a.equals(s2)) || ((!a.equals(s1) && a.equals(s2))))) {
				cnt++;
			}
			if (!a.equals(s1) && s2.equals(""))
				s2 = a;
		}
	if(cnt==1)System.out.println("Yes");
	else System.out.println("No");
	}
}