a,b = list(map(int,input().split())) n = 1 for i in range(2,(a | b) + 1): n *= i print(n)