Given is an integer S. Find how many sequences there are whose terms are all integers greater than or equal to 3, and whose sum is equal to S. The answer can be very large, so output it modulo 10^9 + 7.

Constraints

* 1 \leq S \leq 2000
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


S


Output

Print the answer.

Examples

Input

7


Output

3


Input

2


Output

0


Input

1729


Output

294867501

import java.util.*;
import java.io.*;

public class Main {

	private static final int mod =(int)1e9+7;
	public static void main(String[] args) throws Exception  {
	      Scanner  sc=new Scanner(System.in);
	      PrintWriter out=new PrintWriter(System.out);

	   int s=sc.nextInt();

	   int dp[]=new int[3003];
	    dp[0]=0;
	    dp[1]=0;;
	    dp[2]=0;
	    dp[3]=1;
	    for(int i=4;i<=s;i++) {
	      dp[i]=dp[i-1]+dp[i-3];
	      dp[i]%=mod;
	    }
System.out.println((dp[s]+mod)%mod);
	}
static long nos(int dp[][],int a[],int n,int s) {
  if(n==0) {
    return 0;
  }
  if(s==0) {
    return 1;
  }
  if(a[n-1]>=3&&a[n-1]<=s) {

   return nos(dp,a,n,s-a[n-1])+nos(dp,a,n-1,s);
  }else {
    return nos(dp,a,n-1,s);
  }
}

	static boolean vis[]=new boolean[10001];
	      static long gcd(long a, long b) 
	      { 
	          if (a == 0) 
	              return b; 
	          return gcd(b % a, a); 
	      } 

static long nCr(int n,int r) {
  int dp[][]=new int[2001][2001];
  for(int i=0;i<2001;i++) {
    dp[0][i]=0;
  }
  for(int i=0;i<2001;i++) {
    dp[i][0]=1;
  }
  for(int i=1;i<2001;i++) {
    for(int j=1;j<2001;j++) {
      if(i==j) {
        dp[i][j]=1;
      }else {
        dp[i][j]=dp[i-1][j-1]+dp[i][j-1];
      }
    }
  }
  return dp[n][r];
}
//	     
//	      
}