מִי שֶׁמֵּתוֹ מוּטָל לְפָנָיו – פָּטוּר מִקְּרִיאַת שְׁמַע, מִן הַתְּפִלָּה, וּמִן הַתְּפִלִּין. נוֹשְׂאֵי הַמִּטָּה, וְחִלּוּפֵיהֶן, וְחִלּוּפֵי חִלּוּפֵיהֶן, אֶת שֶׁלִּפְנֵי הַמִּטָּה וְאֶת שֶׁלְּאַחַר הַמִּטָּה: אֶת שֶׁלַּמִּטָּה צֹרֶךְ בָּהֶן – פְּטוּרִין, וְאֶת שֶׁאֵין לַמִּטָּה צֹרֶךְ בָּהֶן – חַיָּבִין. אֵלּוּ וָאֵלּוּ – פְּטוּרִין מִן הַתְּפִלָּה.

One who’s dead (relative) lies before him; is exempt from reciting Shema, from Prayer and from Teffilin. The pall bearers, their replacements and the replacements of their replacements, those before the stretcher and those after the stretcher: those that are needed for (carrying) the stretcher are exempt and those that are not needed for the stretcher are obligated. These and these are exempt from Prayer.