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