#include <bits/stdc++.h>
using namespace std;
int n, k;
int v[100001];
unsigned long long AIB[15][100001];
void update(int lin, int poz, unsigned long long val) {
  while (poz <= n) {
    AIB[lin][poz] += val;
    poz += (poz & -poz);
  }
  return;
}
unsigned long long f(int lin, int poz) {
  unsigned long long rez = 0LL;
  while (poz >= 1) {
    rez += AIB[lin][poz];
    poz -= (poz & -poz);
  }
  return rez;
}
unsigned long long query(int lin, int st, int dr) {
  return f(lin, dr) - f(lin, st - 1);
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n; i++) {
    int col;
    col = v[i];
    update(1, col, 1);
    for (int lin = 2; lin <= k + 1; lin++) {
      unsigned long long rez;
      rez = query(lin - 1, 1, col - 1);
      update(lin, col, rez);
    }
  }
  cout << query(k + 1, 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;
int n, k;
int v[100001];
unsigned long long AIB[15][100001];
void update(int lin, int poz, unsigned long long val) {
  while (poz <= n) {
    AIB[lin][poz] += val;
    poz += (poz & -poz);
  }
  return;
}
unsigned long long f(int lin, int poz) {
  unsigned long long rez = 0LL;
  while (poz >= 1) {
    rez += AIB[lin][poz];
    poz -= (poz & -poz);
  }
  return rez;
}
unsigned long long query(int lin, int st, int dr) {
  return f(lin, dr) - f(lin, st - 1);
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n; i++) {
    int col;
    col = v[i];
    update(1, col, 1);
    for (int lin = 2; lin <= k + 1; lin++) {
      unsigned long long rez;
      rez = query(lin - 1, 1, col - 1);
      update(lin, col, rez);
    }
  }
  cout << query(k + 1, 1, n);
  return 0;
}

```