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