s = input() assert len(s) == 3 for c in s: assert "A" <= c <= "Z" print("Yes" if s[0] == s[1] != s[2] else "No")