import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) mod=10**9+7 if n==1: print(1) else: a,b,c=1,1,0 for i in range(2,n): a,b,c=c,(a+c)%mod,b print((a+b+c)%mod)