No tag edit access

C. Subsequences

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputFor the given sequence with *n* different elements find the number of increasing subsequences with *k* + 1 elements. It is guaranteed that the answer is not greater than 8·10^{18}.

Input

First line contain two integer values *n* and *k* (1 ≤ *n* ≤ 10^{5}, 0 ≤ *k* ≤ 10) — the length of sequence and the number of elements in increasing subsequences.

Next *n* lines contains one integer *a*_{i} (1 ≤ *a*_{i} ≤ *n*) each — elements of sequence. All values *a*_{i} are different.

Output

Print one integer — the answer to the problem.

Examples

Input

5 2

1

2

3

5

4

Output

7

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/28/2017 02:09:22 (c2).

Desktop version, switch to mobile version.
User lists

Name |
---|