import math A,B = map(int,input().split()) print (math.factorial(A | B))