import sys input=lambda:sys.stdin.readline().rstrip() N=int(input()) print((N+(N//2)*((N+1)//2))%(10**6+7))