N = int(input()) S = input() if S.count("(")*2 == N: print ("Yes") else: print ("No")