N = int(input()) MOD = 10 ** 9 + 7 M = N - 4 # A001399 ans = 3 * (M // 6) * (M // 6 + 1) + (M % 6) * (M // 6 + 1) + int(not M % 6) ans %= MOD print(ans)