import re


def binary_as_bytes(binary):
    """Reformat binary string as a sequence of bytes."""

    if not binary:
        return binary
    bits = re.sub(r'\s', '', binary)
    bites = re.findall('[01]{8}', bits)
    if bits != ''.join(bites):
        return binary
    return ' '.join(bites)