# -*- coding: utf-8 -*- N = input() mem1 = 1 mem2 = 0 mem3 = 0 for i in xrange(1, N): mem1, mem2, mem3 = mem3 % 1000000007, mem1, (mem1 + mem2) print (mem1 + mem2 + mem3) % 1000000007