I=input N=I() a=[0,0] for c in I():a[c==')']+=1 print("YNeos"[a[0]!=a[1]::2])