n=int(input()) M=10**9+7 q=1 c=[0,0] c[1%2]=q for i in range(2,n+1): q=i*c[(i%2)^1]%M c[i%2]+=q c[i%2]%=M print(q)