n = int(input()) s = list(input().rstrip()) if s == [')','(']: print('No') exit() print('Yes' if s.count('(') == s.count(')') else 'No')