A staircase has T steps to climb. You are given a set of m distinct allowed stride sizes; on each move you advance by one of these strides, and each stride size may be used any number of times. Two climbing sequences are considered different if the strides are taken in a different order (order matters — using stride 1 then stride 2 is different from stride 2 then stride 1).
Count how many distinct ordered sequences of strides add up to exactly T.
Input format
Line 1: two integers T and m.
Line 2: m distinct positive integers — the allowed stride sizes.
Output format
A single integer: the number of ordered stride sequences summing exactly to T.
Constraints
- 1 ≤ T ≤ 12
- 1 ≤ m ≤ 4
- Each stride size is between 1 and T, and all stride sizes are distinct.