#include <bits/stdc++.h>
using namespace std;
const long long M = 1e5 + 5;
long long bit[11][M];
void update(long long id, long long val, long long t) {
  while (id <= 1e5) {
    bit[t][id] += val;
    id += id & -id;
  }
}
long long query(long long id, long long t) {
  long long sum = 0;
  while (id > 0) {
    sum += bit[t][id];
    id -= id & -id;
  }
  return sum;
}
int32_t main() {
  long long n, k, x;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> x;
    update(x, 1, 0);
    for (long long j = 1; j <= k; j++) update(x, query(x - 1, j - 1), j);
  }
  cout << query(100000, k);
}

### Prompt

Your task is to create a cpp solution to the following problem:

For 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·1018.

Input

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

Next n lines contains one integer ai (1 ≤ ai ≤ n) each — elements of sequence. All values ai are different.

Output

Print one integer — the answer to the problem.

Examples

Input

5 2
1
2
3
5
4


Output

7

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long M = 1e5 + 5;
long long bit[11][M];
void update(long long id, long long val, long long t) {
  while (id <= 1e5) {
    bit[t][id] += val;
    id += id & -id;
  }
}
long long query(long long id, long long t) {
  long long sum = 0;
  while (id > 0) {
    sum += bit[t][id];
    id -= id & -id;
  }
  return sum;
}
int32_t main() {
  long long n, k, x;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> x;
    update(x, 1, 0);
    for (long long j = 1; j <= k; j++) update(x, query(x - 1, j - 1), j);
  }
  cout << query(100000, k);
}

```