s = input() if s[0] == s[1]: print('Yes') elif s[0] == s[1] == s[2]: print('No') else: print('No')