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.io.*;
import java.util.*;

public class test {

	public static String getLine(BufferedReader buf) {
		String line = null;
		try {
			line = buf.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return line;
	}

  static int bestEqual = 1;
  static int[][] cache = new int[301][301];
  public static void fillGo(int[] arr) {
    for (int i = 1; i <= 300; i++) {
      for (int j = i; j <= 300; j++) {
        cache[i][j] = go(i,j,arr);
        if (i == j) { bestEqual = bestEqual > cache[i][j] ? bestEqual : cache[i][j]; }
        //System.out.format("%d %d %d\n", i, j, cache[i][j]);
      }
    }
  }

  public static int go(int low, int high, int[] arr) {
    int[] sol = new int[arr.length];
    Arrays.fill(sol,0);
    for (int i = 0; i < arr.length; i++) {
      if (low <= arr[i] && arr[i] <= high) {
        sol[i] = 1 > sol[i] ? 1 : sol[i];
        for (int j = 0; j < i; j++) {
          if (low <= arr[j] && arr[j] <= high && arr[j] <= arr[i]) {
            sol[i] = sol[i] > sol[j] + 1 ? sol[i] : sol[j] + 1;
          }
        }
      }
    }
    int ret = -1;
    for (int i = 0; i < sol.length; i++) { ret = ret > sol[i] ? ret : sol[i]; }
    return ret;
  }

  public static int func(int endNum, int T) {
    if (T == 1) {
      int v = cache[1][endNum];
      return v;
    }
    int sol = 0;
    for (int i = 0; i < distNums.length; i++) {
      if (distNums[i] > endNum) break;
      int v = distNums[i];
      int cand = prev[i] + cache[v][endNum];
      sol = cand > sol ? cand : sol;
    }
    return sol;
  }

  static int[] distNums = null;

  static int[] prev = null;

	public static void main(String[] args) {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
    String[] tok = getLine(buf).split(" ");
    int n = Integer.parseInt(tok[0]); int T = Integer.parseInt(tok[1]);
    tok = getLine(buf).split(" ");
    int[] arr = new int[tok.length];
    Set<Integer> s = new HashSet<Integer>();
    for (int i = 0; i < arr.length; i++) { arr[i] = Integer.parseInt(tok[i]); s.add(arr[i]); }
    distNums = new int[s.size()];
    int p = 0;
    for (Integer _s : s) distNums[p++] = _s.intValue();
    Arrays.sort(distNums);
    //System.out.format("%s\n", Arrays.toString(distNums));
    fillGo(arr);
    int sol = 0;
    prev = new int[n];
    int[] next = new int[n];
    for (int i = 1; i <= T; i++) {
      if (i == 1) {
        for (int j = 0; j < distNums.length; j++) {
          prev[j] = func(distNums[j],1);
          sol = sol > prev[j] ? sol : prev[j];
        }
        //System.out.format("%d: %s\n", i, Arrays.toString(prev));
      } else if (i > 300) {
        sol += bestEqual;
      } else {
        for (int j = 0; j < distNums.length; j++) {
          next[j] = func(distNums[j],i);
          sol = sol > next[j] ? sol : next[j];
        }
        //System.out.format("%d: %s\n", i, Arrays.toString(next));
        for (int j = 0; j < prev.length; j++) prev[j] = next[j];
      }
    }
    System.out.println(sol);
	}

}
