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 d1 {
	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public static void main(String[] args) throws IOException {
		new d1().run();
	}

	public void solve() throws IOException {
		int n = nextInt();
		int t = nextInt();

		int a[] = new int[n];
		int cnt[] = new int[301];

		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
			cnt[a[i]]++;
		}

		int dp[][] = new int[301][301];

		for (int i = 0; i < n; i++) {
			for (int j = 300; j > 0; j--) {
				for (int k = 300; k >= j; k--) {
					if (a[i] >= k && dp[j][k] > 0) {
						dp[j][a[i]] = Math.max(dp[j][a[i]], dp[j][k] + 1);
					}
				}
			}
			dp[a[i]][a[i]] = Math.max(dp[a[i]][a[i]], 1);
		}

		long ans[] = new long[301];

		for (int i = 1; i < 301; i++) {
			for (int j = i + 1; j < 301; j++) {
				dp[i][j] = Math.max(dp[i][j - 1], dp[i][j]);
				if (i != 300) {
					dp[i][j] = Math.max(dp[i + 1][j], dp[i][j]);
				}
			}
		}
		
		for (int i = 1; i < 301; i++) {
			for (int j = 1; j <= i; j++) {
				ans[i] = Math.max(ans[i], dp[j][i]);
			}
		}
		
		

		

		int start = 1;

		long answ = 0;

		for (int i = 0; i < Math.min(300, t) - 1; i++) {
			for (int j = 300; j >= 1; j--) {
				for (int j2 = j + 1; j2 <= 300; j2++) {
					if (ans[j2] < dp[j][j2] + ans[j]) {
						ans[j2] = Math.max(ans[j2], (long) dp[j][j2] + ans[j]);
					}
				}
				ans[j] = Math.max(ans[j], dp[j][j] + ans[j]);
			}
		}

		int maxcnt = 0;

		for (int i = 1; i <= 300; i++) {
			for (int j = 1; j <= i; j++) {
				maxcnt = Math.max(maxcnt, cnt[j]);
			}

			answ = Math.max((long)ans[i] + 1l * (t - Math.min(300, t)) * maxcnt, answ);
		}

		out.println(answ);
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}