from collections import * from itertools import * import sys def debug(*args, end="\n"): print(*args, end=end, file=sys.stderr) sys.setrecursionlimit(10 ** 6) MOD = 998244353 trick, treat = map(int, input().split()) ans = 1 for i in range(1, (trick | treat) + 1): ans *= i print(ans) debug("ans")