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