a,b = map(int,input().split()) from operator import mul from functools import reduce print(reduce(mul,[i for i in range(1,(a|b) + 1)]))