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. 

import java.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
public class Main
{
  static FastScanner in = new FastScanner(System.in);
  static StringBuilder sb = new StringBuilder();
  static DecimalFormat df = new DecimalFormat();
  public static void main(String[] args)
  {
    df.setMaximumFractionDigits(20);
    df.setMinimumFractionDigits(20);
    df.setRoundingMode(RoundingMode.DOWN);
    // String formatted = df.format(0.2);
    // Never sort array of primitive type
    int N = in.nextInt();
    int T = in.nextInt();
    int A[] = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = in.nextInt();
    }
    if (T <= 250) {
      int B[] = new int[N * T]; 
      for (int i = 0; i < N * T; i++) {
        B[i] = A[i % N];
      }
      //      System.out.println(Arrays.toString(B));
      System.out.println(helloworld(B, -1, 500));
    } else {
      int ans = 0;
      for (int i = 0; i < N; i++) {
        // A[i]
        int cnt = 0;
        for (int j = 0; j < N; j++) {
          if (A[i] == A[j]) {
            cnt ++;
          }
        }
//        System.out.println("1 = " + cnt);
        cnt *= (T - 200);
//        System.out.println("2 = " + cnt);
        int B[] = new int[N * 100];
        for (int j = 0; j < N * 100; j++) {
          B[j] = A[j % N];
        }
        cnt += helloworld(B, -1, A[i]);
//        System.out.println("3 = " + cnt);
        cnt += helloworld(B, A[i], 500);
//        System.out.println("4 = " + cnt);
        ans = Math.max(ans, cnt);
      }
      System.out.println(ans);
    }
  }
  static int helloworld(int[] B, int mn, int mx) {
    int n = B.length;
    int dp[] = new int[n + 1];
    int INF = 2000;
    Arrays.fill(dp, INF);
    dp[0] = 0;
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (B[i] < mn || mx < B[i]) continue;
      int j = 0;
      for (int delta = n; delta > 0; delta >>= 1) {
        while (j + delta < n && dp[j + delta] <= B[i]) {
          j += delta;
        }
      }
      dp[j + 1] = B[i];
      ans = Math.max(ans, j + 1);
    }
    return ans;
  }
  static BigInteger b(long n) { return BigInteger.valueOf(n);}
  static BigInteger b(String s) { return new BigInteger(s); }
  static BigDecimal bd(double d) { return BigDecimal.valueOf(d);}
  static BigDecimal bd(String s) { return new BigDecimal(s); }
}
class FastScanner
{
  BufferedReader reader;
  StringTokenizer tokenizer;
  FastScanner (InputStream inputStream)
  {
    reader = new BufferedReader(new InputStreamReader(inputStream));
  }
  String nextToken()
  {
    while (tokenizer == null || ! tokenizer.hasMoreTokens())
    {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (Exception e){}
    }
    return tokenizer.nextToken();
  }
  boolean hasNext()
  {
    if (tokenizer == null || ! tokenizer.hasMoreTokens())
    {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (Exception e){ return false; }
    }
    return true;
  }
  int nextInt()
  {
    return Integer.parseInt(nextToken());
  }
}
