program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: s,i,j,n,md=1000000007,ans
    integer(int64), allocatable:: a(:,:)

    read*, s
    allocate(a(s,0:s/3))
    a(:,0) = 0
    a(1,:) = 1

    i=1
    ans=0
    do while(i*3 <= s)
        do j=2,s
            a(j,i) = mod(a(j-1,i)+a(j,i-1),md)
        end do
        n = s-3*i+1
        ans=mod(ans+a(n,i),md)
        i=i+1
    end do
    print'(i0)', ans
end program main