def main(): md=10**6+7 n=int(input()) s=n//2 b=n-s print((s*(b+1)+b)%md) main()