output_description: Print the number of possible values of the sum, modulo (10^9+7).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
attempt: class Combination:
      def __init__(self, size, mod=10**9 + 7):
          self.size = size + 2
          self.mod = mod
          self.fact = [1, 1] + [0] * size
          self.factInv = [1, 1] + [0] * size
          self.inv = [0, 1] + [0] * size
  
          for i in range(2, self.size):
              self.fact[i] = self.fact[i - 1] * i % self.mod
              self.inv[i] = -self.inv[self.mod % i] * (self.mod // i) % self.mod
              self.factInv[i] = self.factInv[i - 1] * self.inv[i] % self.mod
  
      def npr(self, n, r):
          if n < r or n < 0 or r < 0:
              return 0
          return self.fact[n] * self.factInv[n - r] % self.mod
  
      def ncr(self, n, r):
          if n < r or n < 0 or r < 0:
              return 0
          return (
              self.fact[n] * (self.factInv[r] * self.factInv[n - r] % self.mod) % self.mod
          )
  
      def nhr(self, n, r):  # 重複組合せ
          return self.ncr(n + r - 1, n - 1)
  
      def factN(self, n):
          if n < 0:
              return 0
          return self.fact[n]
  
  
  N, K = map(int, input().split())
  MOD = 10**9 + 7
  S = N * (N + 1) // 2
  
  ans = 1
  for d in range(N + 1):
      if N - d < K:
          break
      mx = S - (d * (d + 1) // 2)
      mi = max(0, (N - d - 1) * ((N - d - 1) + 1) // 2)
      ans += (mx - mi + 1) % MOD
      ans %= MOD
  print(ans)
  
problem_description: Statement
  
  We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.
  
  We will choose K or more of these integers. Find the number of possible values
  of the sum of the chosen numbers, modulo (10^9+7).
samples: [{"input": "3 2", "output": "10\n    \n\nThe sum can take 10 values, as follows:\n\n  * (10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n  * (10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n  * (10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n  * (10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n  * (10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n  * (10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n  * (10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n  * (10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n  * (10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n  * (10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\n* * *"}, {"input": "200000 200001", "output": "1\n    \n\nWe must choose all of the integers, so the sum can take just 1 value.\n\n* * *"}, {"input": "141421 35623", "output": "220280457"}]