I want to construct a non-negative function $f:\mathbb R\to\mathbb R$ such that $f$ smoothly vanishes on the interval $[M,\infty)$. This means $\lim_{x\to M-}=0, f(x)=0$ for all $x\geq M$, and also for any $k\geq 1$, $f^{(k)}(x)=0$ for all $x\geq M$ and $\lim_{x\to M-} f^{(k)}(x)=0$ where $f^{(k)}$ means $k$'th derivative of $f$.
If $M=\infty$ instead of a real number, $f(x)=\dfrac{e^x}{(1+e^x)^2}$ works. I want a kind of a Gaussian like function that becomes zero at a finite $M$ but smoothly.
Any help is appreciated.