n=int(input()) R={0:0,1:1} Z=[0,1] for i in range(2,n+1): c=i%2 R[i]=Z[1-c]*i%(10**9+7) Z[c]+=R[i] print(R[n])