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