n = int(input())
mod = 1000007
x = n//2 + 1

if n % 2 == 0:
    y = x
else:
	y = x + 1

print((y*x-1)%mod)