# -*- coding: utf-8 -*- N = int(input()) modulo = 10**9 + 7 dp = [-1] * (10**6+1) def solution(n): if dp[n] > -1: return dp[n] num = -1 if n==1: num = 1 elif n==2 or n==3: num = 2 else: num = solution(n-2) + solution(n-3) dp[n] = num return dp[n] print(solution(N) % modulo)