N = int(input()) up = N >> 1 down = N - up print((up * (down + 1) + down) % 1000007)