According to Chinese mythology, a Nin (年year nin4)is a beast that
The Story of Nin

Long long time ago, there is a man-eating predatory beast called Nin (年year nin4). Nian dwelled deep in the sea the whole year long, but on every Chinese New Year eve(除夕ceoi4 zik6 ) it would climb onto the shore to devour livestock and harm humans in a near-by village(村chuen1). Therefore, every Chinese New Year's Eve, all the villagers would take their old and young deep into the mountains to hide from Nian.

One Chinese New Year's Eve a grey haired man appeared in the village. He asked permission to stay for the night and assured everyone that he would chase away(趕走gon2 jau2) the beast. No one believed him, the villagers departed without him.

When the beast arrived at the village to wreck havoc as usual, it was met with a sudden burst of exploding firecrackers(爆竹baau3zuk1). Startled by the noise, the flashes of light, and red banners flying about, it hastily turned and fled!
The following day, as the people returned from the mountains, they found the village intact and safe. The old man had left, but they found the remains of the three precious items he had used to chase the beast Nian away. They all agreed that the old man must be a deity(神san4) who had come to help free them of the beast.