Please subscribe to the official Codeforces channel in Telegram via the link: https://t.me/codeforces_official.
×

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-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

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-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/17/2018 21:12:11 (d3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|