""" 最初と最後は空白→強制処理 それ以外は愚直に """ import sys alp = "abcdefghijklmnopqrstuvwxyz" dic = {} for i in range(26): dic[alp[i]] = i eve = [0] * 26 odd = [0] * 26 S = input() if len(S) == 0: print ("NO") sys.exit() for i in range(len(S)): if S[i] not in dic: continue if i % 2 == 0: eve[dic[S[i]]] += 1 else: odd[dic[S[i]]] += 1 ans = "NO" dic[" "] = float("inf") for i in range(26): if eve[i] > 0 and odd[i] > 0: continue elif eve[i] > 1 or odd[i] > 2: ans = "Yes" elif eve[i]==1 and (S[-1] not in dic or dic[S[-1]] != i): ans = "Yes" elif odd[i]==1 and (S[-1] not in dic or dic[S[-1]] != i): ans = "Yes" print (ans)