How to tell MMA to transform a number to a factorial,Is there a native function?

I came across the need to transform a number into a factorial n, with positive integer n, I have searched in the MMA information but I can’t find anything like that.

I imagine an input, which verifies that it is a factorial, and if it is, prints the number in its n-form!

if there is no native function any idea how to implement it?

for example

6402373705728000=18!

51090942171709420000 does not correspond to a factorial.