N = int(input()) a = N//2+1 b = N-a if N%2 == 0: c = 1 else: c = 0 print((int((b+a*(b+1))+c)%1000007))