import sys input = sys.stdin.readline def main() -> None: s = input() print("Yes" if s[0] == s[1] and s[1] != s[2] else "No") if __name__ == "__main__": main()