import numpy as np a=int(input()) mod=1000000007 L=list(range(1,a)) p2 = np.poly1d(L, r = True) L=p2.coef ans=1 for i in L: ans*=i ans%=mod print(int(ans))