import math trick, treat = map(int, input().split()) or_result = trick | treat print(math.factorial(or_result))