import sys import math input = lambda: sys.stdin.readline().rstrip() # ----------------------- # trick, treat = map(int, input().split()) print(math.factorial(trick | treat))