from typing import OrderedDict


def group_vals_by_keys(vals, keys):
    """Returns an ordered dict that maps keys to values.

    :param vals: list.
    :param keys: list.
    """
    assert len(keys) == len(vals)
    map = OrderedDict()
    for val, key in zip(vals, keys):
        if key not in map:
            map[key] = []
        map[key].append(val)
    return map