import math;print(math.factorial(eval(input().replace(" ","|"))))