N = int(input()) S = list(input()) stack = [] for s in S: stack.append(s) if len(S) >= 2 and S[-2:] == ["(", ")"]: stack.pop() stack.pop() print("Yes" if not stack else "No")