import math trick,treat = map(int,input().split()) a = int(bin(trick|treat),2) print(math.factorial(a))