n = int(input()) mod=1000007 ans=0 if n%2==0: p=int(n/2) ans=p*p+n else: y=int((n+1)/2) ans=(n-y)*(y+1)+y #print(int(ans)) print(int(ans)%mod)