import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] S = sc.next().toCharArray(); S sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int[] cnt = new int[26]; cnt new int[26] 26 for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++; int i=0; int i=0; i 0 i<S.length i S.length S S.length i++ i++ i cnt[S[i]-'A']++; cnt[S[i]-'A']++ cnt[S[i]-'A'] cnt S[i]-'A' S[i] S i 'A' boolean ok = true; ok true for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2); int i=0; int i=0; i 0 i<26 i 26 i++ i++ i ok &= (cnt[i]==0 || cnt[i]==2); ok &= (cnt[i]==0 || cnt[i]==2) ok (cnt[i]==0 || cnt[i]==2) cnt[i]==0 cnt[i] cnt i 0 cnt[i]==2 cnt[i] cnt i 2 System.out.println(ok ? "Yes" : "No") System.out.println System.out System System.out ok ? "Yes" : "No" ok "Yes" "No" sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int[] cnt = new int[26];
		for(int i=0; i<S.length; i++)
			cnt[S[i]-'A']++;
		boolean ok = true;
		for(int i=0; i<26; i++)
			ok &= (cnt[i]==0 || cnt[i]==2);
		System.out.println(ok ? "Yes" : "No");
		
		sc.close();
	}
}
