import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); char[] n = sc.next().toCharArray(); sc.close(); int[] c = new int[2]; for (int i = 0; i < n.length; i++) { c[n[i] - '0']++; } if (c[0] == 2 || c[1] == 2) { System.out.println("Yes"); } else { System.out.println("No"); } } }