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