import math num1, num2 = map(int, input().split()) if num1 == num2: base = num1 else: base = num1 + num2 list = [i for i in range(1, base)] print(math.prod(list))