What is the meaning of all these ghosts roaming around? Here enters the Buddhist element. Essentially, the festival is based on the Vessantara Jataka. According to Chiang Mai-based resident and Vessantara Jataka-expert John Cadet, who has made a decades-long study of such local phenomena, this may be the ‘world’s oldest living epic’. It features Prince Wetsanthon (Vessantara in Pali), the Buddha’s penultimate reincarnation, who exemplified the Buddhist virtues of kindness and generosity. Such was his generosity that one day he offered his father the king’s white elephant to a drought-stricken neighbouring country, for the elephant possessed the miraculous power of bringing rain wherever it was ridden. When the people heard of this ‘selfless act’, they were furious and demanded the prince be banished. During his exile in the forest, the prince continued to be an exemplar of generosity. He no sooner had a possession than he parted with it in order to achieve the self-perfection that would lead to Enlightenment. At last, the king and people repented of their anger and invited the prince to return. In the city he was welcomed by a huge procession and great rejoicing. The people of Dan Sai have adapted this story to include the many wild forest spirits who had benefitted from his generosity. So they joined in the procession and, essentially, it is this part of the story which is re-enacted during the Phi Ta Khon festival.