PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#QHD0000008. Có bao nhiêu cách cộng (How Do You Add?)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Có bao nhiêu cách cộng (How Do You Add?)

How Do You Add?

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given two positive integers NN and KK, consider all ordered KK-tuples of nonnegative integers (x1,x2,…,xK)(x_1,x_2,\ldots,x_K) satisfying

x1+x2+⋯+xK=N.x_1+x_2+\cdots+x_K=N.

Two tuples are different if their values differ at any position. Count the valid tuples and print the result modulo 1 000 0001\,000\,000.

Input

The input is one line containing two integers NN and KK.

Output

Print one integer: the number of valid ordered tuples modulo 1 000 0001\,000\,000.

Subtasks

  • Subtask 1 (20 points): 1≤N≤121\le N\le 12; 1≤K≤121\le K\le 12.
  • Subtask 2 (30 points): 1≤N≤601\le N\le 60; 1≤K≤601\le K\le 60.
  • Subtask 3 (50 points): 1≤N≤1001\le N\le 100; 1≤K≤1001\le K\le 100.

Examples

Input

20 2

Output

21

Explanation

For K=2K=2, choose x1x_1 from 00 through 2020, then x2=20−x1x_2=20-x_1. There are 2121 choices for x1x_1, hence 2121 ordered pairs.