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