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. 
// practice with rainboy
import java.io.*;
import java.util.*;

public class CF582B extends PrintWriter {
	CF582B() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF582B o = new CF582B(); o.main(); o.flush();
	}

	static final int A = 300;
	int[] tt = new int[A + 1];
	void update(int i, int x) {
		while (i <= A) {
			tt[i] = Math.max(tt[i], x);
			i |= i + 1;
		}
	}
	int query(int i) {
		int x = 0;
		while (i >= 0) {
			x = Math.max(x, tt[i]);
			i &= i + 1;
			i--;
		}
		return x;
	}
	void main() {
		int n = sc.nextInt();
		int t = sc.nextInt();
		int[] aa = new int[n];
		int[] kk = new int[A + 1];
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			aa[i] = a;
			kk[a]++;
		}
		int a_ = 0;
		for (int a = 1; a <= A; a++)
			if (kk[a_] < kk[a])
				a_ = a;
		int m = Math.min(n * n, t);
		for (int h = 0; h < m; h++)
			for (int i = 0; i < n; i++)
				update(aa[i], query(aa[i]) + 1);
		int ans = query(A);
		if (t > n * n)
			ans += (t - n * n) * kk[a_];
		println(ans);
	}
}
