from math import factorial trick, treat = map(int, input().split()) assert 1 <= trick <= 15 assert 1 <= treat <= 15 print(factorial(trick | treat))