Ordered Subsequence

Accepts: 65
Submissions: 160
Time Limit: 4000/2000 MS (Java/Others)
Memory Limit: 32768/32768 K (Java/Others)
Problem Description
A numeric sequence of $a_i$ is ordered if $a_1 \lt a_2 \lt \ldots \lt a_N$. Let the subsequence of the given numeric sequence ($a_1, a_2, \ldots, a_N$) be any sequence ($a_{i1}, a_{i2}, \ldots, a_{iK}$), where $1 \leq i_1 \lt i_2 \lt \ldots \lt i_K \leq N$. For example, sequence (1, 7, 3, 5, 9, 4, 8) has ordered subsequences, eg. (1, 7), (3, 4, 8) and many others. Your program, when given the numeric sequence, must find the number of its ordered subsequence with exact m numbers.
Input
Multi test cases. Each case contain two lines. The first line contains two integers n and m, n is the length of the sequence and m represent the size of the subsequence you need to find. The second line contains the elements of sequence - n integers in the range from 0 to 987654321 each. Process to the end of file. [b][Technical Specification][/b] 1<=n<=10000 1<=m<=100
Output
For each case, output answer % 123456789.
Sample Input
3 2
1 1 2
7 3
1 7 3 5 9 4 8
Sample Output
2
12