#include <bits/stdc++.h>
using namespace std;
const int maxk = 15;
const int maxn = 1e5 + 10;
long long D[maxk][maxn];
long long queryBIT(int k, int x) {
  long long ret = 0;
  while (x > 0) {
    ret += D[k][x];
    x -= x & -x;
  }
  return ret;
}
void addBIT(int k, int x, long long d) {
  while (x < maxn) {
    D[k][x] += d;
    x += x & -x;
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  while (n--) {
    int a;
    cin >> a;
    for (int j = 11; j > 0; j--) {
      addBIT(j, a, queryBIT(j - 1, a));
    }
    addBIT(0, a, 1);
  }
  cout << queryBIT(k, maxn - 1) << endl;
  return 0;
}

### Prompt

Your challenge is to write 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;
const int maxk = 15;
const int maxn = 1e5 + 10;
long long D[maxk][maxn];
long long queryBIT(int k, int x) {
  long long ret = 0;
  while (x > 0) {
    ret += D[k][x];
    x -= x & -x;
  }
  return ret;
}
void addBIT(int k, int x, long long d) {
  while (x < maxn) {
    D[k][x] += d;
    x += x & -x;
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  while (n--) {
    int a;
    cin >> a;
    for (int j = 11; j > 0; j--) {
      addBIT(j, a, queryBIT(j - 1, a));
    }
    addBIT(0, a, 1);
  }
  cout << queryBIT(k, maxn - 1) << endl;
  return 0;
}

```