import math a,b=map(int,input().split()) n=a|b print(math.factorial(n))