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