n=input() p=[1,1,1] for i in xrange(n-1): p+=[p[-3]+p[-2]] print p[-1]%(10**9+7)