n = int(input()) print(( ( (n-4+2)*(n-4+1)//2-((n-4)//2+1)*3 - (2 if (n-4)%3==0 else 0))//6 + ((n-4)//2+1)+(1 if n%3==1 else 0))%1000000007)