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