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