N = int(input()) S = input() if N%2 == 0 and S.count("(") == N//2: print("Yes") else: print("No")