The prayer begins with , where Balaam, sent to curse the Israelites, is instead overcome with awe at God and the Israelites' houses of worship. Its first line of praise is a quote of Balaam's blessing and is thus the only prayer commonly used in Jewish services that was written by a non-Jew. The remainder of the text is derived from passages in Psalms relating to entering the house of worship and preparation for further prayer (; ; ; and ). In this vein is the prayer recited by Jews upon entering the synagogue.