try: S=list(input()) except: print('NO') exit() N=len(S) for l in range(N+1): for r in range(l+1,N+1): if (r-l)==1 and r==N: continue X=set(S[:l]+S[r:]) T=S[:] for i in range(N): if T[i] in X: T[i]=' ' F=1 for i in range(l,min(r+1,N)): if (i-r)&1==0: if T[i]!=' ': F=0 else: if T[i]==' ': F=0 if F: print('Yes') exit() print('NO')