Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
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-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/25/2022 17:19:45 (j3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|