Let $M\subset \mathbb R^2$ be a halfplane and $X$ be a Banach space.

We say that a function $f:M\rightarrow X$ is a of class $C^\infty$ on $M$ if it is of class $C^\infty$ on $int M$, for each multiindex $\alpha$ and for each $x$ from boundary of $M$ there exists $\lim_{y\rightarrow x \atop y\in int M} D^\alpha f(y)$, and function $D^\alpha f$ defined on $int M$ in usual sense and for $x$ from boundary by $D^\alpha f(x) =\lim_{y\rightarrow x \atop y\in int M} D^\alpha f(y)$ is continuous.

Let $M_1=(-\infty, 0] \times \mathbb R$, $M_2=[0,\infty) \times \mathbb R$.

Let's assume that functions $f:M_1\rightarrow X$, $g: M_2 \rightarrow X$ are of class $C^\infty$.

Is it the function $h:\mathbb R^2 \rightarrow X $ defined by $h(x,y)=f(x,y)$ for $(x,y) \in M_1$ and $h(x,y)=g(x,y)$ for $(x,y)\in M_2$ of clas C^\infty$?

Edit:

I forgot to add that for each $(x,y)$ from the boundary of M we assume $f(x,y)=g(x,y)$ and for each boundary point $(x,y)$ and each multindex $\alpha$ we assume that $D^\alpha f(x,y)=D^\alpha g(x,y)$.