n=int(input()) a=input() t1=a.count('(') t2=a.count(')') if t1==t2: print("Yes") else: print("No")