from collections import * from functools import * from itertools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) ans = -1 for i in range(N): j = N - i ans = max(ans,(i+1)*(j+1)- 1) print(ans%(10**6 + 7))