An agreement is legal and enforceable only if it complies with the law of the land and public policy . The essential element of an agreement in contract law . Any agreement is not legally binding if for illegal purpose.
Black’s Law Online Dictionary