class Yukicoder MOD = 1000007 def initialize n = gets.to_i x = n/2 puts (x * (n - x + 1) + (n-x)) % MOD end end Yukicoder.new