import java.util.LinkedHashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		}
	}
} import java.util.LinkedHashMap; LinkedHashMap java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String word = sc.next(); word sc.next() sc.next sc char c; c boolean isEven = true; isEven true LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>(); countWord new LinkedHashMap<Character,Integer>() for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		} int i = 0; int i = 0; i 0 i < word.length() i word.length() word.length word i++ i++ i {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		} {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		} c = word.charAt(i) c word.charAt(i) word.charAt word i if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			} countWord.containsKey(c) countWord.containsKey countWord c {
				countWord.put(c, countWord.get(c)+1);
			} countWord.put(c, countWord.get(c)+1) countWord.put countWord c countWord.get(c)+1 countWord.get(c) countWord.get countWord c 1 {
				countWord.put(c,1);
			} countWord.put(c,1) countWord.put countWord c 1 for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		} int num countWord.values() countWord.values countWord {
			if(num!=2) {
				isEven = false;
			}
		} {
			if(num!=2) {
				isEven = false;
			}
		} if(num!=2) {
				isEven = false;
			} num!=2 num 2 {
				isEven = false;
			} isEven = false isEven false if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		} isEven {
			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 sc = new Scanner(System.in);
		String word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			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 word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		}
	}
} Main
import java.util.LinkedHashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		char c;
		boolean isEven = true;

		LinkedHashMap<Character,Integer> countWord = new LinkedHashMap<Character,Integer>();

		for(int i = 0;i < word.length();i++) {
			c = word.charAt(i);
			if(countWord.containsKey(c)) {
				countWord.put(c, countWord.get(c)+1);
			} else {
				countWord.put(c,1);
			}
		}

		for(int num : countWord.values()){
			if(num!=2) {
				isEven = false;
			}
		}

		if(isEven) {
			System.out.println("Yes");
		} else {

			System.out.println("No");
		}
	}
}