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