n=int(input()) s=str(input()) l,r=0,0 for e in s: if e=="(": l+=1 else: r+=1 if l==r: print("Yes") else: print("No")