#include <bits/stdc++.h>
using namespace std;
inline int lowbit(int x) { return x & (-x); }
int n, k, a;
long long s[100010][12];
inline long long getSum(int x, int y) {
  long long res = 0;
  for (; x > 0; x -= lowbit(x)) res += s[x][y];
  return res;
}
void change(int x, int y, long long d) {
  for (; x <= 100005; x += lowbit(x)) s[x][y] += d;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    change(a, 1, 1);
    if (a == 1) continue;
    for (int j = 2; j <= k + 1; j++) {
      long long tt = getSum(a - 1, j - 1);
      change(a, j, tt);
    }
  }
  cout << getSum(100005, k + 1);
  return 0;
}

### Prompt

Please formulate 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;
inline int lowbit(int x) { return x & (-x); }
int n, k, a;
long long s[100010][12];
inline long long getSum(int x, int y) {
  long long res = 0;
  for (; x > 0; x -= lowbit(x)) res += s[x][y];
  return res;
}
void change(int x, int y, long long d) {
  for (; x <= 100005; x += lowbit(x)) s[x][y] += d;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    change(a, 1, 1);
    if (a == 1) continue;
    for (int j = 2; j <= k + 1; j++) {
      long long tt = getSum(a - 1, j - 1);
      change(a, j, tt);
    }
  }
  cout << getSum(100005, k + 1);
  return 0;
}

```