S = input()

X: set = set()
Y: list = [set()]

ans = True
for i, Si in enumerate(S):
    if Si == "(":
        Y.append(set())
    elif S[i] == ")":
        for s in Y[-1]:
            X.remove(s)
        Y.pop()
    else:
        if Si in X:
            ans = False
            break
        X.add(Si)
        Y[-1].add(Si)

print("Yes" if ans else "No")
