n, k = list(map(int, input().split()))

i = n + 1

mod = 10 ** 9 + 7

ans = 0

while i >= k:

    ans += i * (n - i + 1) + 1

    ans %= mod

    i -= 1

print(ans)
n, k = list(map(int, input().split()))

print(((((-2 + k - n)*(-6 + 2* k**2 - n - n**2 - k*(2 + n)))//6)%(10**9+7)))
n, k = list(map(int, input().split()))
i = n + 1
mod = 10**9 + 7
ans = 0
while i >= k:
    ans += i * (n - i + 1) + 1
    ans %= mod
    i -= 1
print(ans)

n, k = list(map(int, input().split()))
print(
    (
        (((-2 + k - n) * (-6 + 2 * k**2 - n - n**2 - k * (2 + n))) // 6)
        % (10**9 + 7)
    )
)

-i = n + 1 -mod = 10**9 + 7 -ans = 0 -while i >= k: -    ans += i * (n - i + 1) + 1 -    ans %= mod -    i -= 1 -print(ans) +print( +    ( +        (((-2 + k - n) * (-6 + 2 * k**2 - n - n**2 - k * (2 + n))) // 6) +        % (10**9 + 7) +    ) +)