CSES - Counting Tilings | Đếm cách lát gạch

View as PDF

Points: 2000 Time limit: 1.0s Memory limit: 512M Input: stdin Output: stdout

Hãy đếm số cách lấp đầy một lưới \(n × m\) bằng cách sử dụng các viên gạch \(1 × 2\)\(2 × 1\).

Input

  • Dòng đầu vào duy nhất chứa hai số nguyên \(n\)\(m\).

Output

  • In một số nguyên: số lượng cách lát, chia lấy dư cho \(10^9 + 7\).

Constraints

  • \(1 \le n \le 10\)
  • \(1 \le m \le 1000\)

Example

Sample input

4 7

Sample output

781


Comments

There are no comments at the moment.