N = int(input()) S = input() stack = [] for i in S: if(i == "("): stack.append("(") else: if(stack): stack.pop() else: print("No") exit() print("Yes" if len(stack) == 0 else "No")