N = int(input()) P = 10**9+7 if N >= 10**9+7: print(0) else: ans = [1, 927880474, 933245637, 668123525, 429277690, 733333339, 724464507, 957939114, 203191898, 586445753, 698611116][N // (10**8)] for i in range(1 + (N // (10**8))*10**8, N+1): ans = (ans * i) % P print(ans)