N = int(input()) mod = 10**9 + 7 a = 0 b = 1 c = 0 for i in range(N-1): a, b, c = (b+c) % mod, a, b print((a+b+c) % mod)