To hell with any law. If my daughter is at a YMCA or a public bathroom and a guy walks in ten he will get a swift reaction from me and to hell with a law. My chances will be or maybe with a jury .
My first duty as a dad is to protect my 15 year old daughter and that is what I take seriously.
Restrooms are a plumbing question. Your plumbing should match the sign on the restroom you use.