P = 10 ** 9 + 7 x = 1 y = 0 z = 1 N = int(input()) if N == 1: print(1) exit() for i in range(N - 2): x, y, z = y, z, (x + y) % P print((x + y + z) % P)