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