#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
 
//priority_queue<long long, vector<long long>, greater<long long>> pq;

const double TL = 1.5 * CLOCKS_PER_SEC;
mt19937 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count());
#define clr(x, y) memset(x, y, sizeof(x))
#define forn(i, n) for (int i = 0; i < n; i++)
#define LL long long


const double pi = acos(-1.0);

LL mod = 1e9 + 7;
LL n, k;


int main() {
  //auto start_clock = clock();
#ifdef LOCAL
  freopen("in", "r", stdin);
#endif

  LL p = 1;
  for (int i = 1; i <= 100; i++) {
    p = p * 10 % mod;
  }

  LL ans = 0;
  cin >> n >> k;
  for (LL i = k; i <= n + 1; i++) {
    LL l = (p + p + i - 1) * i / 2;
    LL r = (p + n + p + n - i + 1) * i / 2;
    ans += (r - l + 1);
    ans %= mod;
    
  }
  cout << ans << endl;
  return 0;
}