n = gets.to_i m = n / 2 puts ((m + 1)*(n - m + 1) - 1) % 1000007