def is_good_pairing(pairs):
    """Function to test if a pairing is valid."""
    santas = set()
    kiddos = set()

    for santa, kiddo in pairs:
        if santa == kiddo:
            return False
        santas.add(santa)
        kiddos.add(kiddo)

    return len(santas) == len(kiddos) == len(list(pairs))