# -*- coding: utf-8 -*- n, = map(long, raw_input().split()) top = n / 2 bottom = n - top; print (top * (bottom + 1) + bottom) % 1000007