N = input() d = (N-1)/2 print ((N-d)*(d+1)+d)%(10**6+7)