package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
)

var mod int = 1e9 + 7

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	s := io.NextInt()
	combi := NewModCombination(mod)
	ans := 0
	for i := 1; 3*i <= s; i++ {
		ans += combi.Calc(s-3*i+i-1, i-1)
		ans %= mod
	}
	io.Println(ans)
}

// ModMul returns a*b with mod
func ModMul(a, b, mod int) int {
	a, b = a%mod, b%mod
	if b == 0 {
		return 0
	}
	if a*b/b == a {
		return a * b % mod
	}
	panic("overflow")
}

// ModPow returns base^n with mod
func ModPow(base, n, mod int) int {
	ans := 1
	for ; n > 0; n >>= 1 {
		if n&1 == 1 {
			ans = ModMul(ans, base, mod)
		}
		base = ModMul(base, base, mod)
	}
	return ans
}

// ModInv returns inverse value of a with mod
func ModInv(a, mod int) int {
	return ModPow(a, mod-2, mod)
}

// ModFactorial stores factorials with mod
type ModFactorial struct {
	mod    int
	values []int
	invs   []int
}

// NewModFactorial returns new instance of ModFactorial
func NewModFactorial(mod int) *ModFactorial {
	return &ModFactorial{
		mod:    mod,
		values: []int{1},
		invs:   []int{1},
	}
}

// Calc returns n!
func (m *ModFactorial) Calc(n int) int {
	l := len(m.values)
	if n < l {
		return m.values[n]
	}
	tmp := make([]int, n+1-l)
	m.values = append(m.values, tmp...)
	for i := l; i <= n; i++ {
		m.values[i] = i * m.values[i-1] % m.mod
	}
	return m.values[n]
}

// CalcInv returns inverse value of n!
func (m *ModFactorial) CalcInv(n int) int {
	l := len(m.invs)
	if n < l {
		return m.invs[n]
	}
	tmp := make([]int, n+1-l)
	m.invs = append(m.invs, tmp...)
	m.invs[n] = ModInv(m.Calc(n), m.mod)
	for i := n - 1; i >= l; i-- {
		m.invs[i] = m.invs[i+1] * (i + 1) % m.mod
	}
	return m.invs[n]

}

// ModCombination returns the number of combinations with mod
type ModCombination struct {
	mod       int
	factorial *ModFactorial
}

// NewModCombination returns new instance of ModCombination
func NewModCombination(mod int) *ModCombination {
	return &ModCombination{
		mod:       mod,
		factorial: NewModFactorial(mod),
	}
}

// Calc returns nCk
func (m *ModCombination) Calc(n, k int) int {
	if n < k || n < 0 || k < 0 {
		return 0
	}
	fn := m.factorial.Calc(n)
	ifk := m.factorial.CalcInv(k)
	ifnk := m.factorial.CalcInv(n - k)
	ans := ModMul(fn, ifk, m.mod)
	ans = ModMul(ans, ifnk, m.mod)
	return ans
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 1796