alp = "abcdefghijklmnopqrstuvwxyz" dic = {} dic[" "] = float("inf") for i in range(26): dic[alp[i]] = i eve = [0] * 26 odd = [0] * 26 S = input() for i in range(len(S)): if S[i] == " ": continue if i % 2 == 0: eve[dic[S[i]]] += 1 else: odd[dic[S[i]]] += 1 ans = "NO" 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 dic[S[-1]] != i: ans = "Yes" elif odd[i]==1 and dic[S[-1]] != i: ans = "Yes" print (ans)