I think the usual proof of the unicity theorem (for holomorphic functions) shows that the answer is yes.
Actually I think $f$ extends holomorphicallyhas a holomorphic extension to a neighborhood of $\mathbb{R}$, so the answer is yes by the unicity theorem.