from typing import Counter


def ransom_note(magazine, ransom):
    """ Determines if the magazine contains words to write the ransom note """

    magazine_multiset = Counter(magazine)
    note_multiset = Counter(ransom)
    multiset_diff = note_multiset - magazine_multiset

    return len(multiset_diff) == 0