input() ok = True d = 0 for c in input(): if c == '(': d += 1 else: if not d: ok = False d -= 1 ok &= d == 0 print('Yes' if ok else 'No')