S = input().strip() print(['No', 'Yes'][(S[0] == S[1]) and (S[1] != S[2])])