def g(a,N):
    return (a+1)*(N-a+1)-1

N=int(input())

if N%2:
    X=max(g((N+1)//2,N),g((N-1)//2,N))
else:
    X=g(N//2,N)

print(X%(10**6+7))