a,b = map(int,input().split()); a = a|b; ans = 1 for i in range(a): ans *= (i+1) print(ans)