import math first_num, second_num = map(int, input().split()) OR_num = first_num | second_num fact_num = math.factorial(OR_num) print(fact_num)