from math import factorial trick,treat=map(int,input().split()) ans=factorial(trick|treat) print(ans)