import math N,M=map(int,input().split()) ans=(N | M) print(math.factorial(ans))