program redistribution
  implicit none
  integer(8), parameter :: modu = 1000000007
  integer :: s, i, j
  integer(8) :: dp(0:700, 2000) = 0
  read(*,*) s
  dp(1, 3) = 1
  do i = 4, s
    do j = 1, (i + 2) / 3
      dp(j, i) = mod(dp(j, i - 1) + dp(j - 1, i - 3), modu)
    end do
  end do
  write(*,'(i0)') mod(sum(dp(:, s)), modu)
end program redistribution