import sys input = sys.stdin.readline N=int(input()) S=input().strip() x=0 y=0 for s in S: if s=="(": x+=1 else: y+=1 if x==y: print("Yes") else: print("No")