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;
int n, t;
int a[101];
int m[101][101];
int m1[101][101];
void get(int mt[101][101], int x) {
  if (x == 1) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        mt[i][j] = m[i][j];
      }
    }
    return;
  }
  if (x % 2 == 0) {
    int m2[101][101];
    get(m2, x / 2);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        mt[i][j] = -1000000000;
        for (int k = 0; k < n; k++) {
          mt[i][j] = max(mt[i][j], m2[i][k] + m2[k][j]);
        }
      }
    }
  } else {
    int m2[101][101];
    get(m2, x - 1);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        mt[i][j] = -1000000000;
        for (int k = 0; k < n; k++) {
          mt[i][j] = max(mt[i][j], m2[i][k] + m[k][j]);
        }
      }
    }
  }
}
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[j] >= a[i]) {
        m[i][j] = 1;
        for (int k = 0; k < j; k++) {
          if (a[k] <= a[j]) {
            m[i][j] = max(m[i][j], 1 + m[i][k]);
          }
        }
      } else {
        m[i][j] = -1000000000;
      }
    }
  }
  get(m1, t);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ans = max(ans, m1[i][j]);
    }
  }
  cout << ans << endl;
  return 0;
}
