import sys input = sys.stdin.readline x, y = map(int, input().split()) res = 1 for i in range(1, (x | y) + 1): res *= i print(res)