a = input() if a[0] == a[1] and a[1] != a[2]: print("Yes") else: print("No")