Let $R$ be a $\mathbb{C}$-algebra satisfying the following conditions:
(i) $R \subset \mathbb{C}[x_1,\ldots,x_n]$.
(ii) There exist $a_1,\ldots,a_l \in \mathbb{C}[x_1,\ldots,x_n]$ such that $R=\mathbb{C}[a_1,\ldots,a_l]$, for some $l > n$.
(iii) $R_m$ is a UFD, where $m= \langle a_1,\ldots,a_l \rangle$.
Question. Is $R$ a UFD?
A non-example: $R=\mathbb{C}[x^2,x^3] \subset \mathbb{C}[x]$, $m=\langle x^2,x^3 \rangle$. If I am not wrong, condition (iii) does not hold, since $R$ is of course not a UFD ($x^2x^2x^2=x^3x^3$), so its localization at $m$ is also not a UFD.
Perhaps Kaplansky criterion can help? Also, perhaps the list in wikipedia for equivalent conditions for being a UFD may help.
Any hints and comments are welcome! Thank you.
Edit: Mohan's example $R=\mathbb{C}[x^2-1,x^3-1]$ satisfies conditions (i)+(ii)+(iii) (truly, I am not sure why $R_m$ is a UFD), but $R$ is not a UFD. Therefore, I wish to change condition (iii) to the following stronger condition: $R_m$ is regular, where $m= \langle a_1,\ldots,a_l \rangle$.
If I am not wrong, Mohan's example does not satisfy this new condition, since the minimal number of generators of $m$ is $2$ and the Krull dimension of $R_m$ is $1$.