문제 링크텍스트
난관
N, M = map(int, input().split()) if N < 2 or N > 1e18 or M < 1 or M > 1e7: exit() if N < M: y = 1 for i in range(1, N+1): y = (y*i) % M else: y = 0 print(y)