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