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