#include <stdio.h>

int n, s;

int rec(int depth, int ans, int bit)
{
	if (depth == n) return s == ans ? 1 : 0;

	for (int i = 0; i < 10; i++)
	{
		if (!(bit & (1 << i)))
		{
			rec(depth + 1, ans + i, bit + (1 << i));
		}
	}
}

int main()
{
	while (~scanf("%d %d", &n, &s))
	{
		printf("%d\n", rec(0, 0, 0));
	}

	return 0;
}