import hashlib


def valid_proof(last_hash, proof):
    """Validates the Proof.
    Multi-ouroborus:  Do the last five characters of the hash of the last
    proof match the first five characters of the hash of the new proof?

    IE:  last_hash: ...AE912345, new hash 12345E88...
    """
    guess = str(proof).encode()
    guess_hash = hashlib.sha256(guess).hexdigest()
    return guess_hash[:5] == last_hash[-5:]