$ABC$ is a three-digit number in which $A>O$. The value of $ABC$ is equal to the sum of the factorials of its three digits. What is the value of $B$?