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.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;

public class OnceAgain {
	public static void main(String[] args) {
		FasterScanner sc = new FasterScanner();
		
//		int[] gg = { 3, 1, 4, 2 };
//		System.out.println(Arrays.toString(fwdLIS(gg)));
//		System.out.println(Arrays.toString(bwdLIS(gg)));

		int N = sc.nextInt();
		int T = sc.nextInt();
		int[] A = sc.nextIntArray(N);
		
		if (T < 120) {
			int[] arr = repeat(A, T);
			int[] d = fwdLIS(arr);
			int best = d[0];
			for (int i = 1; i < N * T; i++) {
				best = Math.max(best, d[i]);
			}
			System.out.println(best);
		} else {
			int[] arr = repeat(A, 60);
			int[] fwd = fwdLIS(arr);
			int[] bwd = bwdLIS(arr);
			
			int[] freq = new int[301];
			for (int v : A) {
				freq[v]++;
			}
			
			int best = 0;
			for (int i = 59 * N; i < 60 * N; i++) {
				for (int j = arr[i]; j <= 300; j++) {
					for (int k = 0; k < N; k++) {
						if (arr[k] >= j) {
							best = Math.max(best, fwd[i] + ((T - 120) * freq[j]) + bwd[k]);
						}
					}
				}
			}
			System.out.println(best);
		}
	}
	
	public static int[] repeat(int[] A, int r) {
		int N = A.length;
		int[] arr = new int[N * r];
		for (int i = 0; i < r; i++) {
			System.arraycopy(A, 0, arr, i * N, N);
		}
		return arr;
	}
	
	public static int[] fwdLIS(int[] A) {
		int N = A.length;
		int[] d = new int[N];
		int[] b = new int[N + 1];
		int maxLen = 0;
		for (int i = 0; i < N; i++) {
			int idx = findIdxLEQ(b, A[i], 0, maxLen);
			d[i] = idx + 1;
			if (d[i] > maxLen) {
				b[d[i]] = A[i];
				maxLen = d[i];
			} else {
				b[d[i]] = Math.min(b[d[i]], A[i]);
			}
		}
		return d;
	}
	
	public static int findIdxLEQ(int[] A, int val, int L, int R) {
		int good = 0;
		while (L <= R) {
			int M = (L + R) / 2;
			if (A[M] <= val) {
				good = M;
				L = M + 1;
			} else {
				R = M - 1;
			}
		}
		return good;
	}
	
	public static int[] bwdLIS(int[] A) {
		int N = A.length;
		int[] arr = Arrays.copyOf(A, N);
//		System.out.println("x => " + Arrays.toString(arr));
		for (int i = 0; i < N; i++) {
			arr[i] = 301 - arr[i];
		}
//		System.out.println("y => " + Arrays.toString(arr));
		return reverse(fwdLIS(reverse(arr)));
//		int[] d = new int[N];
//		for (int i = N - 1; i >= 0; i--) {
//			d[i] = 1;
//			for (int j = N - 1; j > i; j--) {
//				if (A[j] >= A[i]) {
//					d[i] = Math.max(d[i], d[j] + 1);
//				}
//			}
//		}
//		return d;
	}
	
	public static int[] reverse(int[] arr) {
		for (int i = 0, j = arr.length - 1; i < j; i++, j--) {
			int tmp = arr[i];
			arr[i] = arr[j];
			arr[j] = tmp;
		}
		return arr;
	}

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			return nextIntArray(n, 0);
		}

		public int[] nextIntArray(int n, int off) {
			int[] arr = new int[n + off];
			for (int i = 0; i < n; i++) {
				arr[i + off] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			return nextLongArray(n, 0);
		}

		public long[] nextLongArray(int n, int off) {
			long[] arr = new long[n + off];
			for (int i = 0; i < n; i++) {
				arr[i + off] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}