import math def main(): a, b = map(int, input().split()) ans = math.factorial(a | b) print(ans) if __name__ == "__main__": main()