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