import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); char[] chars = scanner.next().toCharArray(); scanner.close(); if (chars[0] == chars[1] && chars[1] != chars[2]) { System.out.println("Yes"); } else { System.out.println("No"); } } }