# -*- coding: utf-8 -*- N = int(input()) if N%2 == 0: print(int(N**2/4 + N) % (10**6+7)) else: print(int(-1/4+N**2/4+N) % (10**6+7))