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

sum = 0



for i in range(k, n+2):

	minunchi = (i*(i-1))//2

	maxunchi = (n*(n+1))//2 - ((n+1-i)*(n-i))//2

	sum += maxunchi - minunchi + 1



print((sum%(10**9+7)))
n,k=list(map(int,input().split()))

print((sum([(n*(n+1))//2-((n+1-i)*(n-i))//2-(i*(i-1))//2+1 for i in range(k,n+2)])%(10**9+7)))
n, k = list(map(int, input().split()))
sum = 0
for i in range(k, n + 2):
    minunchi = (i * (i - 1)) // 2
    maxunchi = (n * (n + 1)) // 2 - ((n + 1 - i) * (n - i)) // 2
    sum += maxunchi - minunchi + 1
print((sum % (10**9 + 7)))

n, k = list(map(int, input().split()))
print(
    (
        sum(
            [
                (n * (n + 1)) // 2
                - ((n + 1 - i) * (n - i)) // 2
                - (i * (i - 1)) // 2
                + 1
                for i in range(k, n + 2)
            ]
        )
        % (10**9 + 7)
    )
)

-sum = 0 -for i in range(k, n + 2): -    minunchi = (i * (i - 1)) // 2 -    maxunchi = (n * (n + 1)) // 2 - ((n + 1 - i) * (n - i)) // 2 -    sum += maxunchi - minunchi + 1 -print((sum % (10**9 + 7))) +print( +    ( +        sum( +            [ +                (n * (n + 1)) // 2 +                - ((n + 1 - i) * (n - i)) // 2 +                - (i * (i - 1)) // 2 +                + 1 +                for i in range(k, n + 2) +            ] +        ) +        % (10**9 + 7) +    ) +)