def create_first_n_1_bits_mask(n, k):
    """ Return a binary mask of first n bits of 1, k bits of 0s"""
    if n < 0 or k < 0:
        raise ValueError("n and k cannot be negative number")

    if n == 0:
        return 0

    mask = (2 << n) - 1
    return mask << k