import math t1, t2 = map(int, input().split()) print(math.factorial(t1 | t2))