Dear friends

According to A.K. Warder's grammar book, the relative pronoun should
agree with the word it denotes in gender and number. If so why in the
following sentence the relative pronoun is "ya.m" rather than "yo".
Did ancient grammarians explain this before?

Naahaṃ, bhikkhave, a~n~na.m ekasaddampi samanupassaami ya.m eva.m
itthiyaa citta.m pariyaadaaya tit.t.hati yathayida.m, bhikkhave,
purisasaddo.

with much metta

Tzungkuen