#include <stdio.h>
typedef long long ll;
#define MOD 1000000007
int min(int x, int y) { return x < y ? x : y; }
int gcd(int x, int y) {
	int r;
	while ((r = x % y) != 0) {
		x = y;
		y = r;
	}
	return y;
}
int comb(int n, int r) {
	int ans = 1;
	for (int i = 0; i < r; i++) {
		ans *= n;
		ans %= MOD;
	}
	while (r > 1) {
		ans /= r;
		r--;
	}
	return ans;
}
int main() {
	int n, k, a[100000];
	ll cnt = 1;
	scanf("%d%d", &n, &k);
	for (int i = 0; i < n; i++) {
		a[i] = 1;  //とりあえず全部1から
	}
	for (int i = 2; i <= k; i++) {	   //変える数字
		for (int j = 0; j < n; j++) {  //変える場所
			int C = comb(n, min(n - j - 1, j + 1));
			a[j] = i;
			int GCD = gcd(a[0], a[1]);
			for (int l = 2; l < n; l++) {
				GCD = gcd(GCD, a[l]);
			}
			// printf("C:%d\n", C);
			cnt += GCD * C;
			cnt %= MOD;
		}
	}
	printf("%lld\n", cnt);
	return 0;
}