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