n = int(input()) s = input() a = s.count("(") b = s.count(")") print("Yes" if a == b else "No")