a,b=list(map(int,input().split())) c=int(bin(a|b),2) import math print(math.factorial(c))