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