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