b, c = map(int, input().split()) a = b | c ans = 1 for i in range(1,a+1): ans = ans * i print("{}".format(ans))