N = int(input()) P = 10 ** 9 + 7 S = (N-2) * (N-3) // 2 c = 0 if (N-4) % 3 == 0: c += 1 S2 = (N-4) // 2 + 1 - c S3 = S - S2 * 3 - c S3 //= 6 print((c + S2 + S3) % P)