As long as the agreement is voluntary, the expression of will is true, and it does not violate the mandatory provisions of laws and regulations, and does not violate public order and good customs. It is legal and effective in principle.
Article link: Article 143 of the General Principles of Civil Law
A civil juristic act that meets the following conditions is valid:
(1) The actor has corresponding capacity for civil conduct;
(2) the meaning is true;
(three) does not violate the mandatory provisions of laws and administrative regulations, and does not violate public order and good customs.