n=int(input()) s=input() t=0 m=1 for c in s: if c=='(':t+=1 else:t-=1 if t<0: m=0 if t!=0:m=0 if m:print("Yes") else:print("No")