Yosef Karo, Shulchan Aruch — Yoreh Deah 393
“ A mourner, during the first three days, he does not leave the house of mourning and not to the graveyard. From here and onward, if someone in his neighborhood has a relative die, he follows the funeral bier to go to the graveyard but does not sit with the consolers, but rather in the place of the mourners. ”
