#include <bits/stdc++.h>
using namespace std;
long long dp[11][100001], a[100000], n, k;
void upd(int x, int y, long long val) {
  for (; x <= n; x += x & -x) dp[y][x] += val;
}
long long que(int x, int y) {
  long long ret = 0;
  for (; x; x -= x & -x) ret += dp[y][x];
  return ret;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    upd(a[i], 0, 1ll);
    for (int j = 1; j <= k; ++j) upd(a[i], j, que(a[i] - 1, j - 1));
  }
  cout << que(n, k) << endl;
}

### Prompt

In Cpp, your task is to solve 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 dp[11][100001], a[100000], n, k;
void upd(int x, int y, long long val) {
  for (; x <= n; x += x & -x) dp[y][x] += val;
}
long long que(int x, int y) {
  long long ret = 0;
  for (; x; x -= x & -x) ret += dp[y][x];
  return ret;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    upd(a[i], 0, 1ll);
    for (int j = 1; j <= k; ++j) upd(a[i], j, que(a[i] - 1, j - 1));
  }
  cout << que(n, k) << endl;
}

```