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