N = int(input()) S = list(input()) wa = sum([1 if S[i] == '(' else -1 for i in range(N)]) print("Yes" if (N % 2 == 0 and wa == 0) else "No")