n = int(input()) s = input() if n%2 != 0: exit(print('No')) stack = [] for i in range(n): if len(stack) == 0: stack.append(s[i]) else: if stack[-1][-1] == ")" and s[i] == "(": stack.pop(-1) elif stack[-1][-1] == "(" and s[i] == ")": stack.pop(-1) else: stack.append(s[i]) flg = len(stack) == 0 print('Yes'if flg else'No')