a,b = map(int,input().split()) x = a|b ans = 1 for i in range(1,x+1): ans *= i print(ans)