t1,t2 = map(int,input().split()) k = t1|t2 out = 1 for i in range(k): out *= (i+1) print(out)