S=input() if(S[0]==S[1] and len(set(list(S)))==2):print("Yes") else:print("No")