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;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = 1 << 29;
const int MAXA = 300;
struct M {
  M() : vec(MAXA * MAXA, 0) {}
  M(const M& o) : vec(o.vec) {}
  M(M&& o) : vec(MAXA * MAXA, 0) { swap(vec, o.vec); }
  M& operator=(const M& o) {
    vec = o.vec;
    return *this;
  }
  M& operator=(M&& o) {
    swap(vec, o.vec);
    return *this;
  }
  int get(int i, int j) const { return vec[i * MAXA + j]; }
  void set(int i, int j, int v) { vec[i * MAXA + j] = v; }
  vector<int> vec;
};
void combine(const M& m1, const M& m2, M& out) {
  for (int i = 0; i < (MAXA); ++i)
    for (int j = (i); j <= (MAXA - 1); ++j) {
      int v = 0;
      for (int k = (i); k <= (j); ++k) {
        v = max(v, m1.get(i, k) + m2.get(k, j));
      }
      out.set(i, j, v);
    }
}
void pow(const M& m, int e, M& out) {
  out = M();
  M p(m);
  while (e) {
    if (e & 1) {
      M t;
      combine(out, p, t);
      swap(out, t);
    }
    M t;
    combine(p, p, t);
    swap(p, t);
    e >>= 1;
  }
}
M base(int n) {
  M m;
  for (int i = 0; i < (n + 1); ++i) m.set(i, n, 1);
  return m;
}
int N, T;
int A[120];
int main() {
  scanf("%d%d", &N, &T);
  for (int i = 0; i < (N); ++i) scanf("%d", A + i);
  for (int i = 0; i < (N); ++i) --A[i];
  vector<M> ms;
  for (int i = 0; i < (N); ++i) ms.push_back(base(A[i]));
  M cycle = ms[0];
  M nextCycle;
  for (int i = (1); i <= (N - 1); ++i) {
    combine(cycle, ms[i], nextCycle);
    swap(cycle, nextCycle);
  }
  pow(cycle, T, nextCycle);
  swap(cycle, nextCycle);
  int best = 0;
  for (int i = 0; i < (MAXA); ++i)
    for (int j = (i); j <= (MAXA - 1); ++j) {
      best = max(best, cycle.get(i, j));
    }
  printf("%d\n", best);
  return 0;
}
