12. (40 points) Solve the equation

$$
2024\left(\frac{1}{n!}-\frac{1}{m!}\right)=\frac{m}{n!}-\frac{1}{m!}
$$

in natural numbers.
Answer: $m=n=1$ or $n=2022, m=2023$.

Solution. Rewrite the equation as $2024(m!-n!)=m \cdot m!-n!,(2024-m) m!=$ $=2023 n!$. Next, consider several scenarios.

If $m=n$, then $2024-m=2023$, that is, $m=n=1$.

If $m>n$, then $m=n+k$, where $k$ is a natural number. In this case, the equation takes the form $(2024-(n+k))(n+1)(n+2) \ldots(n+k)=2023$. Note that $2023=$ $=7 \cdot 17^{2}$, so there are no more than four factors on the left side of the last equation. However, if $k=3$ (four factors) or $k=2$ (three factors), then the left side has a product of three or two consecutive natural numbers, which is impossible. Therefore, $k=1$ and the equation $(2024-n-1)(n+1)=2023$ has the unique natural solution $n=2022$.