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)+n%3)%1000000007)