n=int(input()) s=input() p=0 for c in s: p+=1 if c=="(" else -1 if p<0: print("No") exit() if p==0: print("Yes") else: print("No")