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