#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100005, MAXK = 15;
long long n, k, a, bit[MAXK][MAXN];
void update(long long id, long long now, long long val) {
  for (long long i = now; i < MAXN; i += (i & (-i))) {
    bit[id][i] += val;
  }
}
long long query(long long id, long long now) {
  long long ret = 0;
  for (long long i = now; i > 0; i -= (i & (-i))) {
    ret += bit[id][i];
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  k++;
  update(0, 1, 1);
  for (long long i = 1; i <= n; i++) {
    cin >> a;
    a++;
    for (long long j = k; j >= 1; j--) {
      long long dp = query(j - 1, a - 1);
      update(j, a, dp);
    }
  }
  cout << query(k, MAXN - 1) << '\n';
  return 0;
}

### Prompt

Please provide a CPP coded solution to the problem described below:

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 MAXN = 100005, MAXK = 15;
long long n, k, a, bit[MAXK][MAXN];
void update(long long id, long long now, long long val) {
  for (long long i = now; i < MAXN; i += (i & (-i))) {
    bit[id][i] += val;
  }
}
long long query(long long id, long long now) {
  long long ret = 0;
  for (long long i = now; i > 0; i -= (i & (-i))) {
    ret += bit[id][i];
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  k++;
  update(0, 1, 1);
  for (long long i = 1; i <= n; i++) {
    cin >> a;
    a++;
    for (long long j = k; j >= 1; j--) {
      long long dp = query(j - 1, a - 1);
      update(j, a, dp);
    }
  }
  cout << query(k, MAXN - 1) << '\n';
  return 0;
}

```