N = int(input()) S = input() fl = 1 cnt = 0 for c in S: x = 1 if c=='(' else -1 cnt += x if cnt < 0: fl = 0 break print("Yes" if fl and cnt==0 else"No")