N,K=list(map(int,input().split()))

ans=0

kari=[i for i in range(N+1)]

for i in range(K,N+2):

    saidai=(N+N-i+1)*i//2

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

    ans+=saidai-saisyou+1



ans%=10**9+7

print(ans)
N,K=list(map(int,input().split()))

ans=0

for i in range(K,N+2):

    saidai=(N+N-i+1)*i//2

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

    ans+=saidai-saisyou+1



ans%=10**9+7

print(ans)
N, K = list(map(int, input().split()))
ans = 0
kari = [i for i in range(N + 1)]
for i in range(K, N + 2):
    saidai = (N + N - i + 1) * i // 2
    saisyou = (i - 1) * i // 2
    ans += saidai - saisyou + 1
ans %= 10**9 + 7
print(ans)

N, K = list(map(int, input().split()))
ans = 0
for i in range(K, N + 2):
    saidai = (N + N - i + 1) * i // 2
    saisyou = (i - 1) * i // 2
    ans += saidai - saisyou + 1
ans %= 10**9 + 7
print(ans)

-kari = [i for i in range(N + 1)]