#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 10, MD = 1e9 + 7;
long long n, m, a[MX], ans, tmp, k, fen[MX][20];
void add(long long x, long long len, long long val) {
  for (; x <= MX; x += x & (-x)) fen[x][len] += val;
}
long long get(long long x, long long len) {
  long long res = 0;
  for (; x > 0; x -= x & (-x)) res += fen[x][len];
  return res;
}
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < n; i++) {
    add(a[i], 1, 1);
    for (int j = 2; j <= k + 1; j++) add(a[i], j, get(a[i] - 1, j - 1));
  }
  printf("%lld", get(n, k + 1));
}

### Prompt

In Cpp, your task is to solve 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 int MX = 1e5 + 10, MD = 1e9 + 7;
long long n, m, a[MX], ans, tmp, k, fen[MX][20];
void add(long long x, long long len, long long val) {
  for (; x <= MX; x += x & (-x)) fen[x][len] += val;
}
long long get(long long x, long long len) {
  long long res = 0;
  for (; x > 0; x -= x & (-x)) res += fen[x][len];
  return res;
}
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < n; i++) {
    add(a[i], 1, 1);
    for (int j = 2; j <= k + 1; j++) add(a[i], j, get(a[i] - 1, j - 1));
  }
  printf("%lld", get(n, k + 1));
}

```