N = gets.to_i up = N >> 1 down = N - up puts (up * (down + 1) + down) % 1000007