Many influences of the thought of the three religions in ancient Japan, Shintoism, Confucianism and Buddhism, were found in the high society of the Heian period (794-1185/1192).
It was believed that one of the influences was the principle of retribution. For instance, a person who was born deaf or mute is a result of the inappropriate behavior in the past.
The Hokkekyo Shu (法華経: School of the Lotus Sutra), one of the Buddhist teachings, has the following phrases related to the persons with disabilities.
Even if one can become man, the person can't hear, neither he sees nor speaks as a punishment, because he has had criticized the sutra.
The Tale of Genji (源氏物語) is a classic work of Japanese literature written by a court lady Murasaki Shikibu (紫式部) in the early 11th century, around the peak of the Heian period. It has been said the first great novel in world literature.
It can be read as sort of Buddhism parable. The principle of karma, or retribution, is also a notion to which the Japanese were strongly attracted.
In the chapter of the Tale called "the everlasting summer", the woman named Omi conversed with the lieutenant general about about the principle of retribution.