SP2817 INCDSEQ - Distinct Increasing Subsequences
Description
Given a sequence of N (1 ≤ N ≤ 10,000) integers S $ _{1} $ , ..., S $ _{N} $ (0 ≤ S $ _{i} $ < 1,000,000,000), compute the number of distinct increasing subsequences of S with length K (1 ≤ K ≤ 50 and K ≤ N).
Input Format
The first line contains the two integers N and K. The following N lines contain the integers of the sequence in order.
Output Format
Print a single integer representing the number of distinct increasing subsequences of S of length K, modulo 5,000,000.