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