n=int(input()) a=0 S=input() for x in S: if x=='(': a+=1 else: a-=1 if a<0: print('No') exit() if a: print('No') else: print('Yes')