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