
Pierre makes macarons. Round macarons go into square boxes of size 1 × 1, and oval macarons go into rectangular boxes of size 1 × 2. A rectangular box can be turned to sit as a 2 × 1 box instead.
For a buffet, Pierre wants to cover a rectangular table of size N × M with these two kinds of boxes so that no empty space is left. Boxes cannot overlap and cannot stick out of the table. The sides of a box always stay parallel to the sides of the table. The width N of the table is small, so that a guest can grab the macarons easily, and the length M is large, so that the table serves many guests.
Count the number of ways to cover the table.