a,b=map(int,input().split()) c=a|b ans=1 for i in range(c): ans*=i+1 print(ans)