n=int(input()) x=[0,1] b=10**9+7 for i in range(2,n): x[i%2]+=(i*x[1-i%2])%b print(1 if n<2 else (n*x[1-n%2])%b)