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.Arrays;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.List;
import java.math.BigInteger;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Comparator;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author shu_mj @ http://shu-mj.com
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    Scanner in;
    PrintWriter out;

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
        run();
    }

    void run() {
        int n = in.nextInt();
        int t = in.nextInt();
        int[] is = in.nextIntArray(n);
        if (t < 400) {
            go(n, t, is);
            return ;
        }
        int[] js = new int[n * 200];
        for (int i = 0; i < n * 200; i++) {
            if (i < n) js[i] = is[i];
            else js[i] = js[i - n];
        }
        int m = Algo.max(is);
        int[] left = new int[m + 1];
        for (int i : js) {
            int v = 0;
            for (int j = 0; j <= i; j++) {
                v = Math.max(v, left[j]);
            }
            left[i] = v + 1;
        }
        int[] right = new int[m + 1];
        for (int i = js.length - 1; i >= 0; i--) {
            int v = 0;
            for (int j = js[i]; j <= m; j++) {
                v = Math.max(v, right[j]);
            }
            right[js[i]] = v + 1;
        }
        int[] cnt = new int[m + 1];
        for (int i : is) cnt[i]++;
        int res = 0;
        for (int i = 0; i <= m; i++) {
            if (cnt[i] != 0) {
                res = Math.max(res, cnt[i] * (t - 400) + left[i] + right[i]);
            }
        }
        out.println(res);
    }

    private void go(int n, int t, int[] is) {
        int[] js = new int[n * t];
        for (int i = 0; i < n * t; i++) {
            if (i < n) js[i] = is[i];
            else js[i] = js[i - n];
        }
        int m = Algo.max(is);
        int[] left = new int[m + 1];
        for (int i : js) {
            int v = 0;
            for (int j = 0; j <= i; j++) {
                v = Math.max(v, left[j]);
            }
            left[i] = v + 1;
        }
        out.println(Algo.max(left));
    }
}

class Scanner {
    BufferedReader br;
    StringTokenizer st;

    public Scanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
        eat("");
    }

    private void eat(String s) {
        st = new StringTokenizer(s);
    }

    public String nextLine() {
        try {
            return br.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String s = nextLine();
            if (s == null)
                return false;
            eat(s);
        }
        return true;
    }

    public String next() {
        hasNext();
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

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

}

class Algo {


    public static int max(int[] is) {
        int res = Integer.MIN_VALUE;
        for (int i = 0; i < is.length; i++) {
            res = Math.max(res, is[i]);
        }
        return res;
    }

}

