#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int mod = (int)1e9 + 7;
const int inf = 1 << 29;
int n, m;
int a[100010];
unsigned long long c[20][200010];
int lowbit(int x) { return x & (-x); }
void update(int len, int x, unsigned long long val) {
  while (x <= 200000) {
    c[len][x] += val;
    x += lowbit(x);
  }
}
unsigned long long sum(int len, int x) {
  unsigned long long ret = 0;
  while (x) {
    ret += c[len][x];
    x -= lowbit(x);
  }
  return ret;
}
int main() {
  cin >> n >> m;
  m++;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    update(1, a[i], 1);
    for (int j = 1; j < m; j++) update(j + 1, a[i], sum(j, a[i] - 1));
  }
  cout << sum(m, n) << endl;
  return 0;
}

### 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 double pi = acos(-1.0);
const double eps = 1e-8;
const int mod = (int)1e9 + 7;
const int inf = 1 << 29;
int n, m;
int a[100010];
unsigned long long c[20][200010];
int lowbit(int x) { return x & (-x); }
void update(int len, int x, unsigned long long val) {
  while (x <= 200000) {
    c[len][x] += val;
    x += lowbit(x);
  }
}
unsigned long long sum(int len, int x) {
  unsigned long long ret = 0;
  while (x) {
    ret += c[len][x];
    x -= lowbit(x);
  }
  return ret;
}
int main() {
  cin >> n >> m;
  m++;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    update(1, a[i], 1);
    for (int j = 1; j < m; j++) update(j + 1, a[i], sum(j, a[i] - 1));
  }
  cout << sum(m, n) << endl;
  return 0;
}

```