#include <bits/stdc++.h>
using namespace std;
long long n, k;
vector<vector<long long>> ft(12, vector<long long>(100005, 0));
void add(long long kk, long long ind, long long val) {
  while (ind <= n) {
    ft[kk][ind] += val;
    ind += ind & -ind;
  }
}
long long sum(long long kk, long long ind) {
  long long res = 0;
  while (ind > 0) {
    res += ft[kk][ind];
    ind -= ind & -ind;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  vector<long long> arr(n + 1);
  for (int i = 1; i < n + 1; i++) cin >> arr[i];
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < 12; j++) {
      if (j == 1)
        add(1, arr[i], 1);
      else {
        long long val = sum(j - 1, arr[i] - 1);
        add(j, arr[i], val);
      }
    }
  }
  cout << sum(k + 1, n);
  return 0;
}

### 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 n, k;
vector<vector<long long>> ft(12, vector<long long>(100005, 0));
void add(long long kk, long long ind, long long val) {
  while (ind <= n) {
    ft[kk][ind] += val;
    ind += ind & -ind;
  }
}
long long sum(long long kk, long long ind) {
  long long res = 0;
  while (ind > 0) {
    res += ft[kk][ind];
    ind -= ind & -ind;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  vector<long long> arr(n + 1);
  for (int i = 1; i < n + 1; i++) cin >> arr[i];
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < 12; j++) {
      if (j == 1)
        add(1, arr[i], 1);
      else {
        long long val = sum(j - 1, arr[i] - 1);
        add(j, arr[i], val);
      }
    }
  }
  cout << sum(k + 1, n);
  return 0;
}

```