x, y = map(int, input().split()) bitResult = x|y print(math.factorial(bitResult))