We have where and

There are several ways to solve this.

1. We first consider the number of possibilities without the restriction

We have (1) ways

Now we will consider the restriction, indeed if we have to substract the cases in which from (1)

If

So there are ways to do this.

Therefore the final answer would be

2. By Generating Functions

Note that it is the coefficient of in the product

This is easy to calculate

By the Binomial Theorem: so

Thus:

Then the coefficient is

(Here notice that again we are substracting the extra we'd have without the restriction)