Let $M$ be a compact real analytic manifold and let $f:M\rightarrow \mathbb C$ is real analytic function such that $f(M)\subset S^1$ where $S^1$ is the unit circle. Then by the extension property there exists a holomorphic extension $\tilde f:X\rightarrow \mathbb C$ such that $\tilde f|_M=f$ where $X$ is a complex manifold containing $M$ as a generic submanifold.
My question: Is it true that $\tilde f^{-1}(\tilde f(M))=M$?