import math t,tt = map(int,input().split()) print(math.factorial(t|tt))