You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing sequence of the given array.

Input

The first line contains two space-separated integers: n, T (1 ≤ n ≤ 100, 1 ≤ T ≤ 107). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 300).

Output

Print a single number — the length of a sought sequence.

Examples

Input

4 3
3 1 4 2


Output

5

Note

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence. 
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101;
int dp[MAXN][MAXN];
struct Mt {
  int m[MAXN][MAXN];
  int n;
  Mt(int n = 0) : n(n) { memset(m, 0, sizeof m); }
  Mt multiply(Mt b) {
    Mt res;
    res.n = n;
    for (int i = 0; i < n; i++) {
      for (int j = i; j < n; j++) {
        for (int k = i; k <= j; k++) {
          res.m[i][j] = max(res.m[i][j], m[i][k] + b.m[k][j]);
        }
      }
    }
    return res;
  }
};
Mt pow(Mt m, int e) {
  if (e == 0) return Mt(m.n);
  if (e % 2 == 0) {
    Mt m2 = pow(m, e / 2);
    return m2.multiply(m2);
  } else {
    return m.multiply(pow(m, e - 1));
  }
}
Mt build(vector<int> v) {
  vector<int> all = v;
  sort(all.begin(), all.end());
  all.resize(unique(all.begin(), all.end()) - all.begin());
  map<int, int> id;
  for (int i = 0; i < all.size(); i++) id[all[i]] = i;
  for (int i = 0; i < v.size(); i++) {
    dp[i][i] = 1;
    for (int j = i + 1; j < v.size(); j++) {
      if (v[j] >= v[i]) {
        for (int k = i; k < j; k++) {
          if (v[k] <= v[j]) {
            dp[i][j] = max(dp[i][j], 1 + dp[i][k]);
          }
        }
      }
    }
  }
  Mt m(all.size());
  for (int i = 0; i < v.size(); i++) {
    for (int j = i; j < v.size(); j++) {
      m.m[id[v[i]]][id[v[j]]] = max(m.m[id[v[i]]][id[v[j]]], dp[i][j]);
    }
  }
  for (int i = 0; i < v.size(); i++) {
    for (int j = i; j < v.size(); j++) {
      for (int k = i; k <= j; k++) {
        m.m[i][j] = max(m.m[i][j], m.m[k][j]);
      }
    }
  }
  for (int i = 0; i < v.size(); i++) {
    for (int j = i; j < v.size(); j++) {
      for (int k = i; k <= j; k++) {
        m.m[i][j] = max(m.m[i][j], m.m[i][k]);
      }
    }
  }
  return m;
}
int main() {
  int n, t;
  cin >> n >> t;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  auto mt = build(v);
  mt = pow(mt, t);
  int best = 0;
  for (int i = 0; i < mt.n; i++)
    for (int j = 0; j < mt.n; j++) best = max(best, mt.m[i][j]);
  cout << best << endl;
  return 0;
}
