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

ans=0

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

    a=0.5*i*(i-1)

    b=0.5*n*(n+1)-0.5*(n-i)*(n-i+1)

    ans+=int(b-a+1)





print((ans%(10**9+7)))
MOD = 10 ** 9 + 7

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



def calc(a):

    smallest = a * (a-1) // 2

    largest = smallest + a * (n-a+1)

    return largest - smallest + 1





ans = 0

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

    ans += calc(a)

    ans %= MOD



print(ans)

n, k = list(map(int, input().split()))
ans = 0
for i in range(k, n + 2):
    a = 0.5 * i * (i - 1)
    b = 0.5 * n * (n + 1) - 0.5 * (n - i) * (n - i + 1)
    ans += int(b - a + 1)
print((ans % (10**9 + 7)))

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


def calc(a):
    smallest = a * (a - 1) // 2
    largest = smallest + a * (n - a + 1)
    return largest - smallest + 1


ans = 0
for a in range(k, n + 2):
    ans += calc(a)
    ans %= MOD
print(ans)

+MOD = 10**9 + 7 + + +def calc(a): +    smallest = a * (a - 1) // 2 +    largest = smallest + a * (n - a + 1) +    return largest - smallest + 1 + + -for i in range(k, n + 2): -    a = 0.5 * i * (i - 1) -    b = 0.5 * n * (n + 1) - 0.5 * (n - i) * (n - i + 1) -    ans += int(b - a + 1) -print((ans % (10**9 + 7))) +for a in range(k, n + 2): +    ans += calc(a) +    ans %= MOD +print(ans)