from math import factorial def main(): trick, treat = map(int, input().split()) print(factorial(trick | treat)) if __name__ == "__main__": main()