from collections import deque d=deque() N=int(input()) c=0 S=input() for s in S: if s=='(': c+=1 else: c-=1 if c==0: print('Yes') else: print('No')