n = gets.to_i d = (n/2).ceil puts ((n%1000007) + (d*n)%1000007 - (d*d)%1000007) %1000007