import math

import queue

 

def readInt():

	return int(eval(input()))

 

def readInts():

	return list(map(int, input().split()))

 

def readChars():

	return input().split()



x = readInts()

n = x[0]

k = x[1]



def ts(l):

	return int((l*(l-1))/2)



def ts2(l):

	return int(l*(n+n-(l-1))/2)



s = 0



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

	s += ts2(i)+1-ts(i)



print((s%(1000000007)))
x=list(map(int,input().split()))

n,k=x

s=0

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

	s+=int(i*(n+n-(i-1))/2)+1-int((i*(i-1))/2)

print((s%(1000000007)))
import math
import queue


def readInt():
    return int(eval(input()))


def readInts():
    return list(map(int, input().split()))


def readChars():
    return input().split()


x = readInts()
n = x[0]
k = x[1]


def ts(l):
    return int((l * (l - 1)) / 2)


def ts2(l):
    return int(l * (n + n - (l - 1)) / 2)


s = 0
for i in range(k, n + 2):
    s += ts2(i) + 1 - ts(i)
print((s % (1000000007)))

x = list(map(int, input().split()))
n, k = x
s = 0
for i in range(k, n + 2):
    s += int(i * (n + n - (i - 1)) / 2) + 1 - int((i * (i - 1)) / 2)
print((s % (1000000007)))

-import math -import queue - - -def readInt(): -    return int(eval(input())) - - -def readInts(): -    return list(map(int, input().split())) - - -def readChars(): -    return input().split() - - -x = readInts() -n = x[0] -k = x[1] - - -def ts(l): -    return int((l * (l - 1)) / 2) - - -def ts2(l): -    return int(l * (n + n - (l - 1)) / 2) - - +x = list(map(int, input().split())) +n, k = x -    s += ts2(i) + 1 - ts(i) +    s += int(i * (n + n - (i - 1)) / 2) + 1 - int((i * (i - 1)) / 2)