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