I=input N=I() b=d=0 for c in I():d+=[-1,1][c<')'];b|=d<0 print("YNeos"[b or d!=0::2])