#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n, k;
long long a[N], ans[11][N], bit[11][N];
void update(long long idx, long long i, long long val) {
  while (i <= n) {
    bit[idx][i] += val;
    i += (i & (-i));
  }
}
long long pref(long long idx, long long i) {
  long long ans = 0;
  while (i >= 1) {
    ans += bit[idx][i];
    i -= (i & (-i));
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    update(1, a[i], 1);
    for (long long curk = 2; curk <= k + 1; curk++)
      update(curk, a[i], pref(curk - 1, a[i] - 1));
  }
  long long ans = pref(k + 1, n);
  cout << ans;
  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 long long N = 1e5 + 5;
long long n, k;
long long a[N], ans[11][N], bit[11][N];
void update(long long idx, long long i, long long val) {
  while (i <= n) {
    bit[idx][i] += val;
    i += (i & (-i));
  }
}
long long pref(long long idx, long long i) {
  long long ans = 0;
  while (i >= 1) {
    ans += bit[idx][i];
    i -= (i & (-i));
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    update(1, a[i], 1);
    for (long long curk = 2; curk <= k + 1; curk++)
      update(curk, a[i], pref(curk - 1, a[i] - 1));
  }
  long long ans = pref(k + 1, n);
  cout << ans;
  return 0;
}

```