N = int(input()) mod = 10 ** 6 + 7 up = N//2 down = N - up print( ((down + 1) * up + down)%mod )