a,b = map(int,input().split()) c = (a or b) for i in range(c+1): if i == 0: s = 1 else: s *= i print(s)