N = int(input()) MOD = 10**9+7 A0 = 0 A1 = 1 a = 1 for i in range(2,N+1): if i%2==0: a = (i*A1)%MOD A0 = (A0+a)%MOD else: a = (i*A0)%MOD A1 = (A1+a)%MOD print(a)