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