def main(): a,b=map(int,input().split()) print(zen(a|b)) def zen(x): if x==1:return 1 return x*zen(x-1) main()