n = int(input()) mod = 10**6 + 7 u, d = n // 2, n - n // 2 print(((d + 1) * u % mod + d) % mod)