trick,treat = map(int,input().split()) def frac(n): if n == 1: return 1 return (n)*frac(n-1) print(frac(trick|treat))