If things are going well, religion and legislation are beneficial; if not, they are of no avail.
or simply: