#include <stdio.h>

int main() {
	long long int ans = 0, usum = 0, dsum = 0;
	int N, K;
	scanf("%d%d", &N, &K);
	printf("%d ", N);
	for (int i = 0; i < K; i++) {
		usum += i;
		dsum += (long long int)N - (long long int)i;
	}
	printf("%lld %lld ", usum, dsum);
	for (int i = K; i <= N; i++) {
		ans += dsum - usum + 1;
		ans = ans % (1000000007);
		usum += i;
		dsum += (long long int)N - (long long int)i;
	}
	printf("%lld", ans + 1);
	return 0;
}