def ok(): print("Yes") exit() def ng(): print("NO") exit() x = input() n = len(x) def check(a, b): for c in a + b[1::2]: b = b.replace(c, ' ') return ' ' not in b[::2] for i in range(n): for j in range(i + 2, n+1): if check(x[:i] + x[j:], x[i:j]):ok() ng()