#include <bits/stdc++.h>
using namespace std;
long long int fn[100001][12];
void add(int i, vector<long long int> &val) {
  while (i < 100001) {
    for (int j = 1; j < 12; j++) {
      fn[i][j] += val[j];
    }
    i += (i & (-i));
  }
}
vector<long long int> sum(int i) {
  vector<long long int> ans(12);
  while (i) {
    for (int j = 1; j < 12; j++) {
      ans[j] += fn[i][j];
    }
    i -= (i & (-i));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  int a[n + 1], ind[n + 1];
  memset(fn, 0, sizeof fn);
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
    ind[a[i]] = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n + 1; i++) {
    int e = a[i];
    vector<long long int> here(12);
    here[1] = 1;
    auto p = sum(ind[e] - 1);
    for (int j = 2; j < 12; j++) {
      here[j] += p[j - 1];
    }
    add(ind[e], here);
  }
  cout << sum(n)[k + 1];
}

### Prompt

Please create a solution in CPP 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;
long long int fn[100001][12];
void add(int i, vector<long long int> &val) {
  while (i < 100001) {
    for (int j = 1; j < 12; j++) {
      fn[i][j] += val[j];
    }
    i += (i & (-i));
  }
}
vector<long long int> sum(int i) {
  vector<long long int> ans(12);
  while (i) {
    for (int j = 1; j < 12; j++) {
      ans[j] += fn[i][j];
    }
    i -= (i & (-i));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  int a[n + 1], ind[n + 1];
  memset(fn, 0, sizeof fn);
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
    ind[a[i]] = i;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n + 1; i++) {
    int e = a[i];
    vector<long long int> here(12);
    here[1] = 1;
    auto p = sum(ind[e] - 1);
    for (int j = 2; j < 12; j++) {
      here[j] += p[j - 1];
    }
    add(ind[e], here);
  }
  cout << sum(n)[k + 1];
}

```