import sys input = sys.stdin.readline mod = 10**9+7 f = [1, 927880474, 933245637, 668123525, 429277690, 733333339, 724464507, 957939114, 203191898, 586445753, 698611116] n = int(input()) if n >= 10**9+7: print(0) sys.exit() i = n//(10**8) j = n % (10**8) ans = f[i] for k in range(1, j+1): ans = (ans*((10**8)*i+k))%mod print(ans)