Unique Brick Tilings Within A Rectangle I was browsing Stackoverflow and saw this question about tiling an MxN rectangle, and I thought it would be great for golfing. Here is the task.

Given the dimension M and N, write a program that outputs how many unique ways a MxN rectangle (N is the number of rows, not columns. Not that it really matters) can be tiled given these constraints.


All tiles are 2x1 or 3x1
All tiles stay within their row (ie they are all horizontal)
Between every two adjacent rows tiles should not be aligned, except on the two ends
M and N are guaranteed to be at least 1


For example, a valid tiling of a 8x3 matrix would be

  2    3     3
  |    |     |
  v    v     v
 _______________
|___|_____|_____| 
|_____|_____|___|
|___|_____|_____|


But the following would be invalid, because the rows align

  2    3     3
  |    |     |
  v    v     v
 _______________
|___|_____|_____| 
|_____|___|_____|
|_____|_____|___|


Test cases:

8x3: 4

3x1: 1

1x1: 0

9x4: 10

Code golf, so shortest answer wins.
Jelly, 20 bytes

2*ḃ€2‘ÄṪ⁼¥Ƈ⁸ṗfƝẸ$€ċ0


Try it online!