from math import factorial trick, treat = map(int, input().split()) print(factorial(trick or treat))