This question has options. Is the word "law" used in the same way in the following two sentences?

There is a law against kidnapping.

By law, one is not allowed to own a wallaby in New York City.

A). different meanings
B). the same meaning
A).