Abu Yazid al-Bestami (also known as Bayazid Bistami), was born in Bestam in north-eastern Persia, where he died in 874 or 877, and where his mausoleum still stands. He is regarded as the founder of the ecstatic (“drunken”) school of Sufism.
One day Abu Yazid was walking with a party of disciples. The road narrowed, and just then a dog approached from the opposite direction. Abu Yazid retired, giving the dog right of way.
The chance thought of disapproval occurred to one of the disciples. “Almighty God honoured man above all creatures. Abu Yazid is the ‘king of the gnostics’ yet with all this dignity, and such a following of disciples, he makes way for a dog. How can that be?”
“Young man,” Abu Yazid replied, “this dog mutely appealed to me, ‘What shortcoming was I guilty of in the dawn of time, and what exceptional merit did you acquire, that I was clad in the skin of a dog whereas you were robed in honour as king of the gnostics?’ This was the thought that came into my head, so I made way for the dog.”
From: Muslim Saints and Mystics: Episodes from the Tadhkirat al-Auliya (‘Memorial of the Saints’) by Farid al-Din Attar, translated by AJ Arberry.