f(x) returns 1 if x is a city, historical event, or historical figure, and 0 otherwise.

