import math a, b = map(int, input().split()) c = a | b print(math.factorial(int(c)))