import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): N, K = getlist() DP = [0] * (N ** 2 + N + 1) DP[0] = 1 for i in range(1, N): DPs = [0] * (N ** 2 + N + 2) for j in range(1, N ** 2 + N + 2): DPs[j] = (DPs[j - 1] + DP[j - 1]) % con # print(DPs) for j in range(N ** 2 + N, -1, -1): if j - i >= 0: DP[j] = DPs[j + 1] - DPs[j - i] else: DP[j] = DPs[j + 1] # print(DP) # print(DP) ans = 0 for i in range(K + 1): ans += DP[i] ans %= con print(ans) if __name__ == '__main__': main()