n = int(input()) a = n // 2 b = n - a c = a + (a+1)*b d = 10**6 + 7 print(c % d)