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