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