N = int(input()) MOD = 10**6+7 def f(x): return -x**2+N*x+N print(max(f(N//2),f(N//2+1))%MOD)