N = int(input()) S = input() di = {"(": 0, ")": 0} for i in S: di[i] += 1 if di["("] == di[")"]: print("Yes") else: print("No")