import math
a,b = map(int,input().split())
print(math.factorial(a or b))